[locale.ctype.general]

# 28 Text processing library [[text]](./#text)

## 28.3 Localization library [[localization]](localization#locale.ctype.general)

### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.ctype.general)

#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#locale.ctype.general)

#### 28.3.4.2.2 Class template ctype [[locale.ctype]](locale.ctype#general)

#### 28.3.4.2.2.1 General [locale.ctype.general]

[ð](#lib:ctype)

namespace std {template<class charT>class ctype : public locale::facet, public ctype_base {public:using char_type = charT; explicit ctype(size_t refs = 0); bool is(mask m, charT c) const; const charT* is(const charT* low, const charT* high, mask* vec) const; const charT* scan_is(mask m, const charT* low, const charT* high) const; const charT* scan_not(mask m, const charT* low, const charT* high) const;
 charT toupper(charT c) const; const charT* toupper(charT* low, const charT* high) const;
 charT tolower(charT c) const; const charT* tolower(charT* low, const charT* high) const;

 charT widen(char c) const; const char* widen(const char* low, const char* high, charT* to) const; char narrow(charT c, char dfault) const; const charT* narrow(const charT* low, const charT* high, char dfault, char* to) const; static locale::id id; protected:~ctype(); virtual bool do_is(mask m, charT c) const; virtual const charT* do_is(const charT* low, const charT* high, mask* vec) const; virtual const charT* do_scan_is(mask m, const charT* low, const charT* high) const; virtual const charT* do_scan_not(mask m, const charT* low, const charT* high) const; virtual charT do_toupper(charT) const; virtual const charT* do_toupper(charT* low, const charT* high) const; virtual charT do_tolower(charT) const; virtual const charT* do_tolower(charT* low, const charT* high) const; virtual charT do_widen(char) const; virtual const char* do_widen(const char* low, const char* high, charT* dest) const; virtual char do_narrow(charT, char dfault) const; virtual const charT* do_narrow(const charT* low, const charT* high, char dfault, char* dest) const; };}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1395)

Class ctype encapsulates the C library [<cctype>](cctype.syn#header:%3ccctype%3e "28.7.1 Header <cctype> synopsis [cctype.syn]") features[.](#1.sentence-1)

istream members are required to use ctype<> for character classing during input parsing[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1400)

The specializations
required in Table [91](locale.category#tab:locale.category.facets "Table 91: Locale category facets") ([[locale.category]](locale.category "28.3.3.1.2.1 Type locale​::​category")),
namely ctype<char> and ctype<wchar_t>,
implement character classing appropriate
to the implementation's native character set[.](#2.sentence-1)
