最終更新日時(UTC):
が更新

履歴 編集

function template
<locale>

std::toupper

namespace std {
  template<class charT>
  charT toupper(charT c, const locale& loc);
}

概要

localeを実引数で指定できるtoupper()関数。 文字cを、ロケールに基いて大文字に変換する。

戻り値

std::use_facet<std::ctype<charT>>(loc).toupper(c)を返す。

備考

localeを引数に取らないtoupper()関数は、<cctype>ヘッダに存在する。

#include <locale>
#include <iostream>

int main()
{
  std::locale l = std::locale::classic();

  std::cout << std::toupper('a', l) << std::endl;
}

出力

A

バージョン

言語

  • C++03

処理系

  • Clang: 1.9, 2.9, 3.1
  • GCC: 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.2, 4.6.3, 4.7.0
  • ICC: 10.1, 11.0, 11.1, 12.0
  • Visual C++: 2003, 2005, 2008, 2010, 2012

実装例

template<class charT> charT toupper(charT c, const locale& loc)
{
  return std::use_facet<std::ctype<charT>>(loc).toupper(c);
}

参照