namespace std {
template <class charT>
bool isspace(charT c, const locale& loc);
}
概要
localeを引数で指定できるisspace()関数。
文字cが空白類文字であるかどうかを、ロケールに基いて判定する。
戻り値
std::use_facet<std::ctype<charT>>(loc).is(std::ctype_base::space, c)を返す。
備考
localeを引数に取らないisspace()関数は、<cctype>ヘッダに存在する。
例
#include <locale>
#include <iostream>
int main()
{
std::locale l = std::locale::classic();
std::cout << std::boolalpha << std::isspace(' ', l) << std::endl;
}
出力
true
バージョン
言語
- C++03
処理系
- Clang: 3.0 ✅
- GCC: 4.3.6 ✅
- Visual C++: 2003 ✅, 2005 ✅, 2008 ✅, 2010 ✅, 2012 ✅
実装例
template <class charT>
bool isspace(charT c, const locale& loc)
{
return std::use_facet<std::ctype<charT>>(loc).is(std::ctype_base::space, c);
}