string name() const; // (1) C++98
概要
ロケールの名前を取得する。
戻り値
*thisが名前を持つ場合、その名前を表す文字列を返す。名前を持たない場合、"*"を返す。
例
#include <iostream>
#include <locale>
int main()
{
std::locale c = std::locale::classic();
std::cout << c.name() << std::endl;
// ファセットを差し替えたロケールは名前を持たない
std::locale unnamed(c, new std::ctype<char>);
std::cout << unnamed.name() << std::endl;
}
出力
C
*
バージョン
言語
- C++98