Template Function CE::Text::Numbers::string_to_number

Function Documentation

template<bool is_unsigned>
NumberVariant CE::Text::Numbers::string_to_number(const std::string &str)

Selects the legacy integer or floating parser from token spelling.

Template Parameters:

is_unsigned – Signedness of integer parsing; does not restrict floating results.

Parameters:

str – Complete token. A dot, e or E selects parse_floats; other tokens use parse_integers.

Throws:
  • CE::Exceptions::invalid_args – For malformed or partially consumed input.

  • CE::Exceptions::bad_request – For numeric range failures. No base autodetection is performed; special floating tokens without a dot/e/E are not selected automatically. Floating finiteness is not enforced.

Returns:

Owned NumberVariant; floating parsing always returns double.