std::regex_traits<CharT>::transform

From cppreference.com
< cpp‎ | regex‎ | regex traits
Regular expressions library
Classes
(C++11)
(C++11)
(C++11)
Algorithms
(C++11)
(C++11)
(C++11)
Iterators
(C++11)
Exceptions
(C++11)
Traits
(C++11)
Constants
(C++11)
(C++11)
Regex Grammar
template < class ForwardIt >
string_type transform( ForwardIt first, ForwardIt last) const ;

Obtains the sort key for the character sequence [ first last ) , such that if a sort key compares less than another sort key with operator<

For example, when the regex flag std::regex_constants::collate is set, then the sequence [a-b] would match some character c1 if traits.transform ( "a" ) <= traits.transform (c1) <= traits.transform ( "b" ) . Note that this function takes a character sequence as the argument to accommodate to the ranges defined like [ [.ae.]-d]

Standard library specializations of std::regex_traits return std::use_facet < std::collate <CharT>> (getloc( ) ).transform (str.data ( ), str.data ( ) + str.length ( ) ) for some temporary string str constructed as string_type str(first, last)

Parameters

first, last - a pair of LegacyForwardIterator
Type requirements
-
ForwardIt must meet the requirements of LegacyForwardIterator

Return value

The collation key for the character sequence [ first last )

Example