cpp/locale/money get/get

Parses monetary value from an input iterator and writes the result to a or string.

@1-2@ Public member functions, call the member function of the most derived class.

@3-4@ Reads characters from the input iterator, expecting to find a monetary value formatted according to the rules specified by the facet imbued in  ( for the rest of this page), the  facet imbued in  ( for the rest of this page), and the stream formatting flags obtained from.

If the input iterator becomes equal to  before the parsing was completed, sets both failbit and eofbit in. If parsing fails for another reason, sets the in. Either way, does not modify the output parameter (( or ) on error.

If the parsing succeeds, does not change, and stores the result in or.

The formatting pattern used by this function is always.

If does not permit thousands separators, the first separator encountered is treated as a parsing error, otherwise they are treated as optional.

If money_base or money_base is the last element in the pattern, the parser does not attempt to consume any whitespace after the other components of the monetary value were parsed. Otherwise, one or more whitespace characters are consumed where money_base appears.

If flag is set in, the currency symbol or currency string is required, if it is not set, the currency symbol is optional.

If the first character of the string returned by or  is found in the money_base position of the formatting pattern, it is consumed, and the rest of the characters in that string are expected and consumed after all other components of the monetary value. If both and   are non-empty, the sign is required and must match the first character of one of these strings. If one of theses strings is empty, the sign is optional (and if it is absent, the sign of the result corresponds to the string that was empty). If both strings are empty, or have the same first character, the result is given the positive sign. If the output parameter is a string and the result is negative, the value  is stored as the first character of the result.

Digits from the input are extracted in order in which they appear and are placed in (after widening by  as necessary), or into a temporary buffer, from which the value of  is constructed as if by

(where is the number of characters extracted from the input and stored in  and  is another sufficiently large character buffer)

Return value
An iterator pointing immediately after the last character recognized as a valid part of the monetary string input.