Standard C++ Library Reference ISO/IEC (VERSION3)
virtual iter_type do_get(iter_type first, iter_type last,
ios_base& iosbase, ios_base::iostate& state,
double& val) const;
virtual iter_type do_get(iter_type first, iter_type last,
ios_base& iosbase, ios_base::iostate& state,
long double& val) const;
virtual iter_type do_get(iter_type first, iter_type last,
ios_base& iosbase, ios_base::iostate& state,
void *& val) const;
virtual iter_type do_get(iter_type first, iter_type last,
ios_base& iosbase, ios_base::iostate& state,
bool& val) const;
The first virtual protected member function endeavors to match sequential elements beginning at first in the sequence
[first, last) until it has recognized a complete, nonempty integer input field. If successful, it converts this field
to its equivalent value as type long, and stores the result in val. It returns an iterator designating the first element
beyond the numeric input field. Otherwise, the function stores nothing in val and sets ios_base::failbit in
state. It returns an iterator designating the first element beyond any prefix of a valid integer input field. In either case,
if the return value equals last, the function sets ios_base::eofbit in state.
The integer input field is converted by the same rules used by the scan functions for matching and converting a series of
char elements from a file. (Each such char element is assumed to map to an equivalent element of type Elem by a
simple, one-to-one, mapping.) The equivalent scan conversion specification is determined as follows:
If iosbase.flags() & ios_base::basefield == ios_base::oct, the conversion specification is
lo.
●
If iosbase.flags() & ios_base::basefield == ios_base::hex, the conversion specification is
lx.
●
If iosbase.flags() & ios_base::basefield == 0, the conversion specification is li.●
Otherwise, the conversion specification is ld.●
The format of an integer input field is further determined by the locale facet fac returned by the call use_facet
<numpunct<Elem>(iosbase. getloc()). Specifically:
fac.grouping() determines how digits are grouped to the left of any decimal point●
fac.thousands_sep() determines the sequence that separates groups of digits to the left of any decimal
point
●
If no instances of fac.thousands_sep() occur in the numeric input field, no grouping constraint is imposed.
Otherwise, any grouping constraints imposed by fac.grouping() is enforced and separators are removed before the
scan conversion occurs.
The second virtual protected member function:
virtual iter_type do_get(iter_type first, iter_type last,
ios_base& iosbase, ios_base::iostate& state,
unsigned long& val) const;
behaves the same as the first, except that it replaces a conversion specification of ld with lu. If successful it converts
the numeric input field to a value of type unsigned long and stores that value in val.
The third virtual protected member function:
virtual iter_type do_get(iter_type first, iter_type last,
ios_base& iosbase, ios_base::iostate& state,
double& val) const;
behaves the same as the first, except that it endeavors to match a complete, nonempty floating-point input field.
fac.decimal_point() determines the sequence that separates the integer digits from the fraction digits. The
equivalent scan conversion specifier is lf.