deduction guides for std::basic_regex
提供: cppreference.com
<tbody>
</tbody>
| ヘッダ <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 に対して提供されます。
例
Run this code
#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
}