std::ctype<CharT>::scan_not, std::ctype<CharT>::do_scan_not
提供: cppreference.com
<tbody>
</tbody>
| ヘッダ <locale> で定義
|
||
public: const CharT* scan_not( mask m, const CharT* beg, const CharT* end ) const; |
(1) | |
protected: virtual const CharT* do_scan_not( mask m, const CharT* beg, const CharT* end) const; |
(2) | |
1) public メンバ関数。 最も派生したクラスの protected virtual メンバ関数
do_scan_not を呼びます。2) 分類マスク
m を満たさない文字配列 [beg, end) 内の最初の文字、つまり、 is(m, c) が false を返すであろう最初の文字 c を探します。引数
| m | - | 検索するマスク |
| beg | - | 検索する文字配列の最初の文字へのポインタ |
| end | - | 検索する文字配列の最後の次へのポインタ |
戻り値
マスクを満たさない [beg, end) 内の最初の文字へのポインタ、またはそのような文字が見つからなかった場合は end。
例
Run this code
#include <locale>
#include <clocale>
#include <iostream>
#include <iterator>
int main()
{
std::setlocale(LC_ALL, "en_US.utf8");
std::wcout.imbue(std::locale("en_US.utf8"));
auto& f = std::use_facet<std::ctype<wchar_t>>(std::wcout.getloc());
// skip leading whitespace
wchar_t s1[] = L" \t\t\n Кошка";
const wchar_t* p1 = f.scan_not(std::ctype_base::space, std::begin(s1), std::end(s1));
std::wcout << "'" << p1 << "'\n";
// skip leading digits
wchar_t s2[] = L"123456789ネプネプ";
const wchar_t* p2 = f.scan_not(std::ctype_base::digit, std::begin(s2), std::end(s2));
std::wcout << "'" << p2 << "'\n";
}
出力:
'Кошка'
'ネプネプ'
関連項目
| 分類テーブルを用いて、指定された分類に分類されないシーケンス内の最初の文字を探します ( std::ctype<char>のパブリックメンバ関数)
| |
[仮想] |
指定された分類に分類される文字シーケンス内の最初の文字を探します (仮想プロテクテッドメンバ関数) |