|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RegexTraits is a traits class that abstracts operations needed for a given character type when as template type parameters forstd::basic_regex.
Given
| 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 | ACopyConstructible type that represents the locale used by the traits class. | |
| X::char_class_type | ABitmaskType type that represents a particular character classification. | |
| X::length(p) | std::size_t | Returns: the smallesti such thatp[i]==0. Complexity is linear ini. |
| v.translate(c) | X::char_type | Returns: a character such that for any characterd considered to be equivalent toc, thenv.translate(c)== v.translate(d). |
| v.translate_nocase(c) | X::char_type | Returns: a character such that for any characterC considered to be equivalent toc without regard to case, thenv.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), thenv.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, thenv.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: whetherc is a member of one of the character classes designated bycl or not. |
| v.value(c, I) | int | Returns:
|
| u.imbue(loc) | X::locale_type |
|
| v.getloc() | X::locale_type | Returns: The previous locale used byv if any. |
RegexTraits is satisfied by the following standard library classes:
template<>class regex_traits<char>; template<>class regex_traits<wchar_t>; | (since C++11) (since C++11) | |