deduction guides for std::basic_regex - cppreference.com (original) (raw)
From cppreference.com
< cpp | regex | basic regex
| Localization library |
|---|
| Regular expressions library (C++11) |
| Formatting library (C++20) |
| Null-terminated sequence utilities |
| Byte strings |
| Multibyte strings |
| Wide strings |
| Primitive numeric conversions |
| to_chars(C++17) to_chars_result(C++17) from_chars(C++17) from_chars_result(C++17) chars_format(C++17) |
| Text encoding identifications |
| text_encoding(C++26) |
| Classes |
|---|
| basic_regex(C++11) |
| sub_match(C++11) |
| match_results(C++11) |
| Algorithms |
| regex_match(C++11) |
| regex_search(C++11) |
| regex_replace(C++11) |
| Iterators |
| regex_iterator(C++11) |
| regex_token_iterator(C++11) |
| Exceptions |
| regex_error(C++11) |
| Traits |
| regex_traits(C++11) |
| Constants |
| syntax_option_type(C++11) |
| match_flag_type(C++11) |
| error_type(C++11) |
| Regex Grammar |
| Modified ECMAScript-262(C++11) |
| Member Functions |
|---|
| basic_regex::basic_regex |
| basic_regex::~basic_regex |
| basic_regex::operator= |
| basic_regex::assign |
| Observers |
| basic_regex::mark_count |
| basic_regex::flags |
| Locale |
| basic_regex::getloc |
| basic_regex::imbue |
| Modifiers |
| basic_regex::swap |
| Constants |
| Non-member Functions |
| swap(std::basic_regex) |
| Deduction guides(C++17) |
| Defined in header | | | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------- | | 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>; | | (since C++17) |
This deduction guide is provided for std::basic_regex to allow deduction from an iterator range.
[edit] Example
Run this code
#include #include int main() { std::vector v = {'a', 'b', 'c'}; std::basic_regex re(v.begin(), v.end()); // uses explicit deduction guide }
Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/regex/basic_regex/deduction_guides&oldid=161255"