Standard C++ Library Reference ISO/IEC (VERSION3)

time_get<wchar_t, istreambuf_iterator<wchar_t> >
time_put<char, ostreambuf_iterator<char> >
time_put<wchar_t, ostreambuf_iterator<wchar_t> >
Category messages (LC_MESSAGES) includes the facets:
messages<char>
messages<wchar_t>
(The last category is required by Posix, but not the C Standard.)
Some of these predefined facets are used by the iostreams classes, to control the conversion of numeric values to and
from text sequences.
An object of class locale also stores a locale name as an object of class string. Using an invalid locale name to
construct a locale facet or a locale object throws an object of class runtime_error. The stored locale name is "*" if
the locale object cannot be certain that a C-style locale corresponds exactly to that represented by the object. Otherwise,
you can establish a matching locale within the Standard C library, for the locale object loc, by calling setlocale(
LC_ALL, loc.name. c_str()).
In this implementation, you can also call the static member function:
static locale empty();
to construct a locale object that has no facets. It is also a transparent locale -- if the template functions has_facet
and use_facet cannot find the requested facet in a transparent locale, they consult first the global locale and then, if
that is transparent, the classic locale. Thus, you can write:
cout.imbue(locale::empty());
Subsequent insertions to cout are mediated by the current state of the global locale. You can even write:
locale loc(locale::empty(), locale::classic(),
locale::numeric);
cout.imbue(loc);
Numeric formatting rules for subsequent insertions to cout remain the same as in the C locale, even as the global locale
supplies changing rules for inserting dates and monetary amounts.
locale::category
typedef int category;
static const category none, collate, ctype, monetary,
numeric, time, messages, all;
The type is a synonym for int so that it can represent any of the C locale categories. It can represent a group of distinct
elements of a bitmask type (which is anonymous) local to class locale. The elements are:
collate, corresponding to the C category LC_COLLATE
ctype, corresponding to the C category LC_CTYPE
monetary, corresponding to the C category LC_MONETARY
numeric, corresponding to the C category LC_NUMERIC
time, corresponding to the C category LC_TIME
messages, corresponding to the Posix category LC_MESSAGES
In addition, two useful values are:
none, corresponding to none of the C categories
all, corresponding to the C union of all categories LC_ALL
You can represent an arbitrary group of categories by ORing these constants, as in monetary | time.