| Localization library | |||||||||||||||||||||||||
| Regular expressions library(C++11) | |||||||||||||||||||||||||
| Formatting library(C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member types | ||||
| Member functions | ||||
(C++26) | ||||
(until C++20) | ||||
| Static member functions | ||||
locale::global | ||||
static locale global(const locale& loc); | ||
Replaces the global C++ locale withloc, which means all future calls to thestd::locale default constructor will now return a copy ofloc. Ifloc has a name, also replaces the C locale as if bystd::setlocale(LC_ALL, loc.name().c_str());. This function is the only way to modify the global C++ locale, which is otherwise equivalent tostd::locale::classic() at program startup.
Contents |
| loc | - | the new global C++ locale |
The previous value of the global C++ locale.
| This section is incomplete Reason: no example |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 8 | C++98 | it was unspecified whether other library functions (such asstd::setlocale) can modify the global C++ locale | specified (no other library functions allowed) |
| constructs a new locale (public member function)[edit] | |
[static] | obtains a reference to the "C" locale (public static member function)[edit] |
| gets and sets the current C locale (function)[edit] |