Namespaces
Variants
Actions

deduction guides for std::basic_regex

From cppreference.com
< cpp‎ | regex‎ | basic regex
 
C++
 
Text processing library
 
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
 
std::basic_regex
Defined in header <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>;
(since C++17)

This deduction guide is provided for std::basic_regex to allow deduction from an iterator range.

[edit] Example

#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
}

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant