std::moneypunct
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Text processing library
Regular expressions library (C++11)
Formatting library (C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++26)
Localization library
moneypunct
(C++11/17/26*)
(C++11/17/26*)
(C++11/17/26*)
(C++11/17/26*)
(C++11/17/26*)
(C++11/17/26*)
std::moneypunct
Member functions
Defined in header
<locale>
template< class CharT, bool International = false >
class moneypunct;
class moneypunct;
The facet std::moneypunct
encapsulates monetary value format preferences. Stream I/O manipulators std::get_money and std::put_money use std::moneypunct
through std::money_get and std::money_put for parsing monetary value input and formatting monetary value output.
std-moneypunct-inheritance.svg
Inheritance diagram
Contents
[edit] Specializations
The standard library is guaranteed to provide the following specializations (they are required to be implemented by any locale object):
Defined in header
<locale>
std::moneypunct<char>
provides equivalents of the "C" locale preferences
std::moneypunct<wchar_t>
provides wide character equivalents of the "C" locale preferences
std::moneypunct<char, true>
provides equivalents of the "C" locale preferences, with international currency symbols
std::moneypunct<wchar_t, true>
provides wide character equivalents of the "C" locale preferences, with international currency symbols
[edit] Nested types
Type
Definition
char_type
CharT
string_type
std::basic_string <CharT>
[edit] Data members
Member
Description
const bool
intl
[static]
International
[edit] Member functions
[edit] Protected member functions
[virtual]
(virtual protected member function) [edit]
[virtual]
(virtual protected member function) [edit]
[virtual]
(virtual protected member function) [edit]
[virtual]
(virtual protected member function) [edit]
[virtual]
(virtual protected member function) [edit]
[virtual]
(virtual protected member function) [edit]
Inherited from std::money_base
Nested types
Type
Definition
enum part { none, space, symbol, sign, value };
unscoped enumeration type
struct pattern { char field[4]; };
the monetary format type
Enumeration constant
Description
none
whitespace is permitted but not required except in the last position, where whitespace is not permitted
space
one or more whitespace characters are required
symbol
the sequence of characters returned by std::moneypunct::curr_symbol is required
sign
the first of the characters returned by std::moneypunct::positive_sign or std::moneypunct::negative_sign is required
value
the absolute numeric monetary value is required