It used to get a locale name and returns the name of the locale, in an implementation-specific manner.
DeclarationFollowing is the declaration for std::locale::name.
C++98string name() const;C++11
string name() const;Parameters
none
Return ValueIt returns a string with the name of the locale, or with "*" if it has no name.
ExceptionsStrong guarantee − if an exception is thrown, there are no effects.
Data racesThe locale object is accessed.
ExampleIn below example explains about std::locale::name.
#include <iostream> #include <locale> int main () { std::locale loc; std::cout << "The global locale should be : " << loc.name() << '\n'; return 0; }
Let us compile and run the above program, this will produce the following result −
The global locale should be : C
locale.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4