Namespaces
Variants
Views
Actions

std::locale::global

From cppreference.com
< cpp‎ | locale‎ | locale
Revision as of 18:57, 2 November 2012 by P12bot (Talk | contribs)

Defined in header <locale>
static locale global( const locale& loc );

Replaces the global C++ locale with loc, which means all future calls to the std::locale default constructor will now return a copy of loc. If loc has a name, also replaces the C locale as if by std::setlocale(LC_ALL, loc.name().c_str());. This function is the only way to modify the global C++ locale, which is otherwise equivalent to std::locale::classic() at program startup.

Contents

Parameters

loc - the new global C++ locale

Return value

The previous value of the global C++ locale.

Example

See also

Template:cpp/locale/locale/dcl list localeTemplate:cpp/locale/locale/dcl list classicTemplate:cpp/locale/dcl list setlocale