Class std::money_put
encapsulates the rules for formatting monetary values as strings. The standard I/O manipulator std::put_money uses the std::money_put
facet of the I/O stream's locale.
Inheritance diagram
If a std::money_put
specialization is not guaranteed to be provided by the standard library (see below), the behaviors of its put() and do_put() are not guaranteed as specified.
The standard library is guaranteed to provide the following specializations (they are required to be implemented by any locale object):
std::money_put<char> creates narrow string representations of monetary values std::money_put<wchar_t> creates wide string representations of monetary valuesIn addition, the standard library is also guaranteed to provide every specialization that satisfies the following type requirements:
CharT
is one of
OutputIt
must meet the requirements of LegacyOutputIterator.char_type
CharT
string_type
std::basic_string<CharT> iter_type
OutputIt
[edit] Data members [edit] Member functions constructs a new money_put
facet
do_put
money_put
facet
Output:
American locale: $123,456.79 German locale: 123.456,79 â¬[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 427 C++98money_put
was guaranteed to accept any CharT
that
CharT
could be
money_put
can guarantee to accept implementation-
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4