cpp/locale/num get/get

@1@ Public member function, calls the member function of the most derived class.

@2@ Reads characters from the input iterator and generates the value of the type of, taking into account I/O stream formatting flags from , character classification rules from , and numeric punctuation characters from. This function is called by all formatted input stream operators such as.

Conversion occurs in three stages:

Stage 1: conversion specifier selection

 * I/O format flags are obtained, as if by


 * If the type of is an integer type, the first applicable choice of the following five is selected:
 * If, will use conversion specifier
 * If, will use conversion specifier
 * If, will use conversion specifier
 * If the type of is signed, will use conversion specifier
 * If the type of is unsigned, will use conversion specifier


 * For integer types, length modifier is added to the conversion specification if necessary: for  and,  for  and
 * If the type of is, will use conversion specifier
 * If the type of is, will use conversion specifier
 * If the type of is, will use conversion specifier
 * If the type of is, will use conversion specifier
 * If the type of is  and, proceeds as if the type of  is , except for the value to be stored in  in stage 3.
 * If the type of is  and, the following replaces stages 2 and 3:
 * Successive characters obtained from the input iterator are matched against the character sequences obtained from  and  only as necessary as to identify the unique match. The input iterator  is compared to  only when necessary to obtain a character.
 * If the target sequence is uniquely matched, is set to the corresponding  value. Otherwise  is stored in  and std is assigned to . If unique match could not be found before the input ended,  is executed.

Stage 2: character extraction

 * If, stage 2 is terminated immediately, no further characters are extracted.
 * The next character is extracted from as if by :
 * If the character matches one of, widened to the locale's char_type as if by , it is converted to the corresponding.
 * If the character matches the decimal point separator, it is replaced by.
 * If the character matches the thousands separator and the thousands separation is in use (as determined by ), then if the decimal point  has not yet been accumulated, the position of the character is remembered, but the character is otherwise ignored. If the decimal point has already been accumulated, the character is discarded and stage 2 terminates.
 * In any case, the check is made whether the obtained from the previous steps is allowed in the input field that would be parsed by std given the conversion specifier selected in stage 1. If it is allowed, it is accumulated in a temporary buffer and stage 2 repeats. If it is not allowed, stage 2 terminates.

Stage 3: conversion and storage

 * The sequence of s accumulated in stage 2 is converted to a numeric value:


 * If the conversion function fails to convert the entire field, the value is stored in.
 * If the type of is a signed integer type and the conversion function results in a positive or negative value too large to fit in it, the most positive or negative representable value is stored in, respectively.
 * If the type of is an unsigned integer type and the conversion function results in a value that does not fit in it, the most positive representable value is stored in.
 * In any case, if the conversion function fails std is assigned to.
 * Otherwise, the numeric result of the conversion is stored in.
 * If the type of is  and boolalpha is not set, then if the value to be stored is,  is stored, if the value to be stored is ,  is stored, for any other value std is assigned to  and  is stored.
 * After this, digit grouping is checked. if the position of any of the thousands separators discarded in stage 2 does not match the grouping provided by, std is assigned to.
 * If stage 2 was terminated by the test, is executed to set the eof bit.