名前空間
変種
操作

std::basic_regex の推論ガイド

From cppreference.com
< cpp‎ | regex‎ | basic regex
 
 
 
正規表現ライブラリ
クラス
(C++11)
アルゴリズム
イテレータ
例外
Traits
定数
(C++11)
正規表現文法
 
 
ヘッダ <regex> で定義
template< class ForwardIt >

basic_regex( ForwardIt, ForwardIt,
             std::regex_constants::syntax_option_type = std::regex_constants::ECMAScript )

-> basic_regex<typename std::iterator_traits<ForwardIt>::value_type>;
(C++17以降)

この推論ガイドは、イテレータ範囲からの推論を可能にするために、std::basic_regex に対して提供されています。

[編集]

#include <regex>
#include <vector>
 
int main()
{
    std::vector<char> v = {'a', 'b', 'c'};
    std::basic_regex re(v.begin(), v.end()); // uses explicit deduction guide
}
English 日本語 中文(简体) 中文(繁體)