Class template std::money_get
encapsulates the rules for parsing monetary values from character streams. The standard I/O manipulator std::get_money uses the std::money_get
facet of the I/O stream's locale.
Inheritance diagram
If a std::money_get
specialization is not guaranteed to be provided by the standard library (see below), the behaviors of its get() and do_get() 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_get<char> parses narrow string representations of monetary values std::money_get<wchar_t> parses 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
InputIt
must meet the requirements of LegacyInputIterator.char_type
CharT
string_type
std::basic_string<CharT> iter_type
InputIt
[edit] Data members [edit] Member functions constructs a new money_get
facet
do_get
money_get
facet
Output:
"$1.11 $2.22 $3.33" parsed with the I/O manipulator: 1.11 2.22 3.33 "USD 1,234.56" parsed with the facet directly: 1234.56[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_get
was guaranteed to accept any CharT
that
CharT
could be
money_get
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