std::regex_traits<CharT>::isctype (3) - Linux Manuals
std::regex_traits<CharT>::isctype: std::regex_traits<CharT>::isctype
NAME
std::regex_traits<CharT>::isctype - std::regex_traits<CharT>::isctype
Synopsis
bool isctype( CharT c, char_class_type f ) const;
Determines whether the character c belongs to the character class identified by f, which, in turn, is a value returned by lookup_classname() or a bitwise OR of several such values.
The version of this function provided in the standard library specializations of std::regex_traits does the following:
1) First converts f to some temporary value m of type std::ctype_base::mask in implementation-defined manner
2) Then attempts to classify the character in the imbued locale by calling std::use_facet<std::ctype<CharT>>(getloc()).is(m, c). If that returned true, true is returned by isctype().
3) Otherwise, checks whether c equals '_' and the bitmask f includes the result of calling lookup_classname() for the character class [:w:], in which case true is returned.
4) Otherwise, false is returned.
Parameters
c - the character to classify
f - the bitmask obtained from one or several calls to lookup_classname()
Return value
true if c is classified by f, false otherwise.
Notes
The description above summarizes C++14; the C++11 phrasing required this function to return true for '_' in all cases (LWG_issue_2018)
Example
// Run this code
Output:
demonstraits a custom regex_traits implementation of lookup_classname/isctype
// Run this code
Output:
See also
lookup_classname (public member function)
do_is classifies a character or a character sequence