class template
<locale>

std::moneypunct

template <class charT, bool International = false> class moneypunct;
Monetary punctuation facet

The moneypunct standard facet provides information about the format of monetary values.

The moneypunct class template has a protected destructor: Programs shall only construct objects of derived classes, or use those installed in locale objects (through use_facet).

All standard locale objects support at least the following facet instantiations of the moneypunct class template as part of the money category:
facets in locale objectsdescription
moneypunct<char>narrow characters
moneypunct<wchar_t>wide characters
moneypunct<char,true>narrow characters, international representation
moneypunct<wchar_t,true>wide characters, international representation

Template parameters

charT
Character type.
This is the type of characters used to produce the representation.
Aliased as member char_type.
International
If true, the representation uses an international format (such as using the three-letter code USD for the US dollar)
If false (the default value), the representation may use a non-international format (such as using the dollar sign, $, for the US dollar).

Member types

member typedefinitiondescription
char_typeThe template parameter (charT)Character type
string_typebasic_string<charT>The basic_string instantiation for characters of type charT (such as string for char).
The class also inherits member types part and pattern from money_base.

Member constants

The following member constants are inherited from money_base (as labels of enum type money_base::part); They are used as the possible values of the elements in the pattern objects returned by members moneypunct::pos_format and moneypunct::neg_format.
member constanttypevaluedescription
nonemoney_base::part0None
spacemoney_base::part1A single space character
symbolmoney_base::part2Currency symbol
signmoney_base::part3Sign: + for positive, - for negative
valuemoney_base::part4Monetary value

The class also contains a two public static constants:
member constanttypedescription
intlboolAlias of the second class template argument: Internation
idlocale::idValue that uniquely identifies facets with moneypunct semantics

Public member functions


Virtual protected member functions

The class defines the virtual protected members which implement the behavior by default of their respective public member functions:

Along with the class destructor

Specializations

At least the following specializations of this template are provided in all library implementations:
specialization
moneypunct<char>
moneypunct<wchar_t>
moneypunct<char,true>
moneypunct<wchar_t,true>