ctype_base Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at ctype_base Class.

The class serves as a base class for facets of template class ctype. A base class for the ctype class that is used to define enumeration types used to classify or test characters either individually or within entire ranges.

struct ctype_base : public locale::facet
{
    enum
 {
    alnum,
 alpha,
    cntrl,
 digit,
    graph,
 lower,
    print,
 punct,
    space,
 upper,
    xdigit
 };
    typedef short mask;
    ctype_base(
 size_t _Refs = 0);

 ~ctype_base();

};

It defines an enumeration mask. Each enumeration constant characterizes a different way to classify characters, as defined by the functions with similar names declared in the header <ctype.h>. The constants are:

You can characterize a combination of classifications by ORing these constants. In particular, it is always true that alnum == ( alpha&#124; **digit**\) and **graph** \=\= \( **alnum**| punct).

Header: <locale>

Namespace: std

Thread Safety in the C++ Standard Library

Show: