std::regex_token_iterator<BidirIt,CharT,Traits>::regex_token_iterator
regex_token_iterator(); |
(1) | (C++11 起) |
regex_token_iterator( BidirIt a, BidirIt b, const regex_type& re, |
(2) | (C++11 起) |
regex_token_iterator( BidirIt a, BidirIt b, const regex_type& re, |
(3) | (C++11 起) |
regex_token_iterator( BidirIt a, BidirIt b, const regex_type& re, |
(4) | (C++11 起) |
template< std::size_t N > regex_token_iterator( BidirIt a, BidirIt b, |
(5) | (C++11 起) |
regex_token_iterator( const regex_token_iterator& other ); |
(6) | (C++11 起) |
regex_token_iterator( BidirIt a, BidirIt b, const regex_type&& re, |
(7) | (C++11 起) |
regex_token_iterator( BidirIt a, BidirIt b, const regex_type&& re, |
(8) | (C++11 起) |
regex_token_iterator( BidirIt a, BidirIt b, const regex_type&& re, |
(9) | (C++11 起) |
template< std::size_t N > regex_token_iterator( BidirIt a, BidirIt b, |
(10) | (C++11 起) |
构造新的 regex_token_iterator
:
- 若构造后,成员
regex_iterator
不是序列尾迭代器,则设置成员指针为当前 std::sub_match 的地址。 - 否则(若成员
regex_iterator
是序列尾迭代器),但值 -1 是submatches
/submatch
中的值之一,则将 *this 转变为指向范围[
a,
b)
的后缀迭代器(整个字符串是非匹配的后缀)。 - 否则,(若 -1 不在子匹配列表中),将 *this 转变为序列尾迭代器。
若 submatches 中任何值小于 -1 则行为未定义。
regex_iterator
和指向 sub_match 的成员指针的复制)。参数
a | - | 指向目标字符序列起始的老式双向迭代器 (LegacyBidirectionalIterator) |
b | - | 指向目标字符序列末尾的老式双向迭代器 (LegacyBidirectionalIterator) |
re | - | 用于在目标字符序列中搜索的正则表达式 |
submatch | - | 应当返回的子匹配的索引。"0" 表示整体匹配,而 "-1" 表示未匹配的部分(例如匹配间的部分) |
submatches | - | 应当在每个匹配内迭代的子匹配的索引的序列,可能包含代表非匹配片段的特殊值 -1 |
m | - | 掌管 re 行为的标志 |
参阅
本节未完成 原因:暂无示例 |
缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
缺陷报告 | 应用于 | 出版时的行为 | 正确行为 |
---|---|---|---|
LWG 2332 | C++11 | 从临时 basic_regex 构造的 regex_token_iterator 立即变为非法
|
通过被删除的重载禁止这种构造 |