找到第一个字符不符合指定的掩码范围。
const CharType *scan_not(
mask maskVal,
const CharType* first,
const CharType* last,
) const;
参数
maskVal
字符与掩码值。first
对于第一个字符的指针在要浏览的范围。last
指向字符的指针在要浏览范围的最后一个字符之后。
返回值
对于第一个字符的指针在不符合指定的掩码范围。如果该值不存在,则函数返回 last。
备注
成员函数返回 do_scan_not(maskVal、first,last)。
示例
// ctype_scan_not.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;
int main( )
{
locale loc1 ( "German_Germany" );
char *string = "Hello, my name is John!";
const char* i = use_facet<ctype<char> > ( loc1 ).scan_not
( ctype_base::alpha, string, string + strlen(string) );
cout << "First nonalpha character is \"" << *i << "\" at position: "
<< i - string << endl;
}
要求
标头: <locale>
命名空间: std