public member function
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);
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
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 ""
- Locale whose facets are used by default in the newly constructed locale.
- 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.
- 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.
- 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.
- Locale object from which the facets specified in cats are used, with the remaining facets being taken from those in parameter other.