Template Function Aux::Parsing::strTo

Function Documentation

template<typename Number, typename CharIterator, typename ValidationPolicy = Checkers::Asserter>
std::tuple<Number, CharIterator> Aux::Parsing::strTo(CharIterator it, CharIterator end)

Parses a range of characters as number.

Requirements: The range [it, end) must contain a valid number.

Parameters:
  • Number – must be either a floating-point-type or an integer-type

  • CharIterator – must be a valid input-iterator over a type that is implicitly convertable to char

  • ValidationPolicy – must be a type that is compatible to the checkers from Enforce.h, the default is Asserter, which will check conditions via assert()

  • it – the start of the character-range

  • end – the end of the character-range

Returns:

: A tuple of the parsed value and the iterator after parsing the number and dropping any surrounding whitespace.