Name
char_traits class template — Base class for character traits
Synopsis
template<typename charT> struct char_traits;
The char_traits
template
describes a character type and provides basic functions for
comparing, converting, and copying character values and arrays. (See
the char_traits<char>
and
char_traits<wchar_t>
specializations later in this section for details.) If you create a
custom character type, you should specialize char_traits<>
or define your own
traits class, which you can provide to basic_string
and other templates as the
traits
template parameter. Your
traits class should define the same members that char_traits<char>
defines. See Chapter 8 for an example.
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.