指定したマスクに一致する範囲の最初の文字を検索します。
const CharType *scan_is(
mask maskVal,
const CharType* first,
const CharType* last,
) const;
パラメーター
maskVal
文字が一致するマスクの値。first
スキャン対象範囲の最初の文字へのポインター。last
スキャン対象範囲の最後の文字に続く文字へのポインター。
戻り値
指定したマスクに一致する範囲の最初の文字へのポインター。このような値がない場合、関数はを返します last.
解説
このメンバー関数は do_scan_is (maskVal、first、last) を返します。
使用例
// ctype_scan_is.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_is
( ctype_base::punct, string, string + strlen(string) );
cout << "The first punctuation is \"" << *i << "\" at position: "
<< i - string << endl;
}
必要条件
ヘッダー: <locale>
名前空間: std