std::basic_regex
的推導指南
來自 cppreference.com
< cpp | regex | basic_regex
在標頭檔案 <regex> 中定義 |
||
template< class ForwardIt > basic_regex( ForwardIt, ForwardIt, |
(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 }