最終更新日時:
が更新

履歴 編集

function
<locale>

std::locale::name

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

関連項目

参照