Standard C++ Library Reference ISO/IEC (VERSION3)
virtual iter_type do_put(iter_type next, bool intl,
ios_base& iosbase, Elem fill, string_type& val) const;
virtual iter_type do_put(iter_type next, bool intl,
ios_base& iosbase, Elem fill, long double& val) const;
};
The template class describes an object that can serve as a locale facet, to control conversions of monetary values to
sequences of type Elem.
As with any locale facet, the static object id has an initial stored value of zero. The first attempt to access its stored
value stores a unique positive value in id.
money_put::char_type
typedef Elem char_type;
The type is a synonym for the template parameter Elem.
money_put::do_put
virtual iter_type do_put(iter_type next, bool intl,
ios_base& iosbase, Elem fill, string_type& val) const;
virtual iter_type do_put(iter_type next, bool intl,
ios_base& iosbase, Elem fill, long double& val) const;
The first virtual protected member function generates sequential elements beginning at next to produce a monetary
output field from the string_type object val. The sequence controlled by val must begin with one or more
decimal digits, optionally preceded by a minus sign (-), which represents the amount. The function returns an iterator
designating the first element beyond the generated monetary output field.
The second virtual protected member function behaves the same as the first, except that it effectively first converts val
to a sequence of decimal digits, optionally preceded by a minus sign, then converts that sequence as above.
The format of a monetary output field is determined by the locale facet fac returned by the (effective) call use_facet
<moneypunct<Elem, intl> >(iosbase. getloc()). Specifically:
fac.pos_format() determines the order in which components of the field are generated for a non-negative
value.
●
fac.neg_format() determines the order in which components of the field are generated for a negative value.●
fac.curr_symbol() determines the sequence of elements to generate for a currency symbol.●
fac.positive_sign() determines the sequence of elements to generate for a positive sign.●
fac.negative_sign() determines the sequence of elements to generate for a negative sign.●
fac.grouping() determines how digits are grouped to the left of any decimal point.●
fac.thousands_sep() determines the element that separates groups of digits to the left of any decimal point.●
fac.decimal_point() determines the element that separates the integer digits from any fraction digits.●
fac.frac_digits() determines the number of significant fraction digits to the right of any decimal point.●
If the sign string (fac.negative_sign or fac.positive_sign) has more than one element, only the first
element is generated where the element equal to money_base::sign appears in the format pattern
(fac.neg_format or fac.pos_format). Any remaining elements are generated at the end of the monetary output
field.
If iosbase.flags() & showbase is nonzero, the string fac.curr_symbol is generated where the element
equal to money_base::symbol appears in the format pattern. Otherwise, no currency symbol is generated.
If no grouping constraints are imposed by fac.grouping() (its first element has the value CHAR_MAX) then no