# std::locale::global

From cppreference.com
< cpp‎ | locale‎ | locale

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.

### Parameters

loc | - | the new global C++ locale

### Return value

The previous value of the global C++ locale.

### Example

| This section is incomplete Reason: no example

### See also

(constructor) | constructs a new locale (public member function)
classic [static] | obtains a reference to the "C" locale (public static member function)
setlocale | gets and sets the current C locale (function)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/locale/locale/global&oldid=58147"