std::ctype<char>::is
STD::Ctype<char>*IS
Defined in header | | |
---|---|---|
bool is(mask m, char c) const; | (1) | |
const char* is(const char* low, const char* high, mask* vec) const; | (2) | |
1%29检查字符是否c
按面具分类m
根据成员函数返回的分类表table()
.有效地计算table()[(unsigned char)c] & m
2%29对字符数组中的每个字符[low, high)
,从成员函数返回的分类表中读取其完整的分类掩码。table()
%28,即,评估table()[ (unsigned char)*p]
并将其存储在vec
如果(unsignedchar)c >=std::ctype<char>::table_size,则替换一个实现定义的值,而不是table()[(unsigned char)c]的值不同,可能会有所不同。c...
参数
c | - | character to classify |
---|---|---|
m | - | mask to use for classifying a single character |
low | - | pointer to the first character in an array of characters to classify |
high | - | one past the end pointer for the array of characters to classify |
vec | - | pointer to the first element of the array of masks to fill |
返回值
1%29true
如果c
按m
在table()
2%29high
注记
与主模板不同std::ctype
,此专门化在对字符进行分类时不执行虚拟函数调用。要自定义行为,派生类可以向基类构造函数提供非默认的分类表。
例
另见
do_is virtual | classifies a character or a character sequence (virtual protected member function of std::ctype) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。