On this page
C++ named requirements: RegexTraits (since C++11)
RegexTraits is a traits class that abstracts operations needed for a given character type when as template type parameters for std::basic_regex.
Requirements
Given
CharT, a character typeX, a RegexTraits type for typeCharTu, an object of typeXv, an object of typeconst Xp, a value of typeconst CharT*I1, I2, input iteratorsF1, F2, forward iteratorsc, a value of typeconst CharTs, an object of typeX::string_typecs, an object of typeconst X::string_typeb, a value of typeboolI, a value of typeintcl, an object of typeX::char_class_typeloc, an object of typeX::locale_type
| expression | return type | semantics |
|---|---|---|
X::char_type |
CharT |
Used to refer to the character type. |
X::string_type |
std::basic_string<CharT> |
|
X::locale_type |
A CopyConstructible type that represents the locale used by the traits class. | |
X::char_class_type |
A BitmaskType type that represents a particular character classification. | |
X::length(p) |
std::size_t |
Returns: the smallest i such that p[i] == 0. Complexity is linear in i. |
v.translate(c) |
X::char_type |
Returns: a character such that for any character d considered to be equivalent to c, then v.translate(c) == v.translate(d). |
v.translate_nocase(c) |
X::char_type |
Returns: a character such that for any character C considered to be equivalent to c without regard to case, then v.translate_nocase(c) == v.translate_nocase(C). |
v.transform(F1, F2) |
X::string_type |
Returns: a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2), then v.transform(G1, G2) < v.transform(H1, H2). |
v.transform_primary(F1, F2) |
X::string_type |
Returns: a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) without regard to case, then v.transform_primary(G1, G2) < v.transform_primary(H1, H2). |
v.lookup_collatename(F1, F2) |
X::string_type |
Returns:
|
v.lookup_classname(F1, F2, b) |
X::char_class_type |
|
v.isctype(c, cl) |
bool |
Returns: whether c is a member of one of the character classes designated by cl or not. |
v.value(c, I) |
int |
Returns:
|
u.imbue(loc) |
X::locale_type |
|
v.getloc() |
X::locale_type |
Returns: The previous locale used by v if any. |
Standard library
RegexTraits is satisfied by the following standard library classes:
|
(since C++11) (since C++11) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/named_req/RegexTraits