public member function
std::locale::locale
<locale>
locale () throw();
locale (const locale& other) throw();
explicit locale (const char* std_name);
locale (const locale& other, const char* std_name, category cats);
template <class Facet>
locale (const locale& other, Facet* f);
locale (const locale& other, const locale& one, category cats);
Locale constructor
Constructs a locale object.
The default constructor constructs a copy of the current global locale, which is the locale set by a previous call to
locale::global, or
locale::classic if
locale::global has not been called.
Constructors with
other as parameter, construct a copy or a partial copy. With the additional parameters, if any, specifying facets not to be copied but redefined instead.
Those with
std_name as parameter, take a C-locale name (such as
"",
"C" or
"POSIX").
Parameters
- other
- Locale whose facets are used by default in the newly constructed locale.
- std_name
- C-string with a standard C locale name.
When it is the only parameter, the resulting locale implements all the semantics associated with that name.
When it is the second parameter, only the categories specified in cats are used in the resulting locale, taking the rest from parameter other's locale.
If this argument is not valid, runtime_error is thrown.
- cats
- Set of categories that are used from the locale specified as second parameter. The remaining categories are taken from the locale specified in the first parameter.
locale::category is a bitmask member type that can either be a combination of a set of constant values (see locale::category), or one of the constants defined in the setlocale function of the C-library.
- f
- Pointer to a facet object (an object derived from locale::facet).
The resulting locale has this specific facet, with the rest of facets being copies of those in parameter other.
The locale object takes over responsibility of deleting this facet object.
- one
- Locale object from which the facets specified in cats are used, with the remaining facets being taken from those in parameter other.