deductiongu...basic_regex(3)
π NAME π
okay bestie, welcome to the deductiongu...basic_regex(3) page from the C++ Standard Libary β yes, that's how it's spelled up top, and we're moving on. The NAME section is serving exactly this:
deductionguidesforstd::basic_regex - deductionguidesforstd::basic_regex
...yes, it says the same thing twice, and honestly? iconic. It's literally the deduction guides for std::basic_regex. π
β¨ Synopsis β¨
Defined in header <regex> β no cap.
template< class ForwardIt >
basic_regex( ForwardIt, ForwardIt,
std::regex_constants::syntax_option_type =
(since C++17)
std::regex_constants::ECMAScript )
-> basic_regex<typename std::iterator_traits<ForwardIt>::value_type>;
This deduction guide is provided for std::basic_regex to allow deduction from an iterator range. That's the whole vibe: iterator range in, basic_regex deduced out, slay. β¨
πΈ Example πΈ
// 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
}
It's giving tiny main-character demo energy: a std::vector<char> holding {'a', 'b', 'c'}, then std::basic_regex re(v.begin(), v.end()); β and the comment is right there saying it uses the explicit deduction guide. Short, sweet, ate. π₯
Source/version check, bestie: http://cppreference.com Β· 2024.06.10 Β· page deductiongu...basic_regex(3) β mwah, bye π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms