|
| to_num (const to_num &)=delete |
|
to_num & | operator= (const to_num &)=delete |
|
| to_num (const char *str) |
|
template<typename Str > |
| to_num (const Str &str) |
|
template<typename Enum , typename std::enable_if< std::is_enum< Enum >::value >::type * = nullptr> |
| operator Enum () const && |
| Conversion to an enum or enum-class. More...
|
|
template<typename Number , typename std::enable_if< std::is_arithmetic< Number >::value >::type * = nullptr> |
| operator Number () const && |
| Conversion to an arithmetic type. More...
|
|
| operator bool () const && |
| Convert to uint8_t first; throw unless 0 or 1; return as bool. More...
|
|
Utility to parse numbers.
This is a dispatcher for std::strto*
functions with additional functionality: throws std::domain_error
if can't parse, or out of bounds, or input has trailing non-whitespaces, or the destination type is unsigned and the input is a negative number.
bouble a = tsv::to_num("");
double b = tsv::to_num(" 123xyz");
int8_t c = tsv::to_num(" 12345 ");
float d = tsv::to_num("12e-456");
uint16_t e = tsv::to_num("-1");
Definition at line 4851 of file fn.hpp.