std::isgraph(std::locale)
Defined in header <locale> | ? | ? |
---|---|---|
template< class charT > bool isgraph( charT ch, const locale& loc ); | ? | ? |
检查给定字符是否被归类为图形字符%28i.e。可打印,不包括给定区域设置的空间%29std::ctype
小面。
参数
ch | - | character |
---|---|---|
loc | - | locale |
返回值
回报true
如果字符被归类为图形,false
否则。
可能的实施
模板<类图表>bool是图%28图表ch,Const std::locale&loc%29{返回std::use[医]facet<std::Ctype<charT>>%28 loc%29 is%28 std::Ctype[医]基::图,ch%29;}
*。
例
演示在不同区域设置下使用ISGET%28%29与特定于%28 OS的%29。
二次
#include <iostream>
#include <locale>
int main()
{
const wchar_t c = L'\u2a0c'; // quadruple integral
std::locale loc1("C");
std::cout << "isgraph('?', C locale) returned "
<< std::boolalpha << std::isgraph(c, loc1) << '\n';
std::locale loc2("en_US.UTF-8");
std::cout << "isgraph('?', Unicode locale) returned "
<< std::boolalpha << std::isgraph(c, loc2) << '\n';
}
二次
产出:
二次
isgraph('?', C locale) returned false
isgraph('?', Unicode locale) returned true
二次
另见
isgraph | checks if a character is a graphical character (function) |
---|---|
iswgraph | checks if a wide character is a graphical character (function) |
? cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com