Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.34 KB

has_facet.md

File metadata and controls

60 lines (46 loc) · 1.34 KB

has_facet

  • locale[meta header]
  • std[meta namespace]
  • function template[meta id-type]
namespace std {
  template <class Facet>
  bool has_facet(const locale& loc) throw();  // (1) C++98

  template <class Facet>
  bool has_facet(const locale& loc) noexcept; // (1) C++11
}

概要

ロケールlocが、テンプレート引数で指定した型Facetのファセットを保持しているかどうかを判定する。

戻り値

ロケールlocが型Facetのファセットを保持していればtrue、そうでなければfalse。

例

#include <locale>
#include <iostream>

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

  std::cout << std::boolalpha;
  std::cout << std::has_facet<std::ctype<char>>(l) << std::endl;
}
  • std::has_facet[color ff0000]
  • std::locale[link locale.md]
  • classic()[link locale/classic.md]
  • std::ctype[link ctype.md]

出力

true

バージョン

言語

  • C++98

処理系

  • Clang: 3.0 [mark verified]
  • GCC: 4.3.6 [mark verified]
  • Visual C++: 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified]

関連項目