最終更新日時:
が更新

履歴 編集

function template
<locale>

std::tolower

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

概要

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

戻り値

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

備考

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

例

#include <locale>
#include <iostream>

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

  std::cout << std::tolower('A', l) << std::endl;
}

出力

a

バージョン

言語

  • C++98

処理系

  • 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 tolower(charT c, const locale& loc)
{
  return std::use_facet<std::ctype<charT>>(loc).tolower(c);
}