All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
Aux::Parsing Namespace Reference

Namespaces

 Impl
 

Functions

template<typename Number , typename CharIterator , typename ValidationPolicy = Checkers::Asserter>
std::tuple< Number, CharIterator > strTo (CharIterator it, CharIterator end)
 Parses a range of characters as number. More...
 

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.

Parameters
Numbermust be either a floating-point-type or an integer-type
CharIteratormust be a valid input-iterator over a type that is implicitly convertable to char
ValidationPolicymust be a type that is compatible to the checkers from Enforce.h, the default is Asserter, which will check conditions via assert()
itthe start of the character-range
endthe end of the character-range

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

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