| one of e1 and e2 is EOF and the other is not. | |
Complexity guarantees length, find, move, copy, and the range version of assign are linear in n.
All other operations are constant time.
Models • char_traits<char>
• char_traits<wchar_t>
See also string
Category: utilities
Component type: type
Description The char_traits class is the default Character Traits class used by the library; it is the only predefined Character Traits class.
Example The char_traits class is of no use by itself. It is used as a template parameter of other classes, such as the basic_string template.
Definition Defined in the standard header string.
Template parameters | Parameter | Description |
| charT | char_traits 's value type, i.e.char_traits<>::char_type. |
Model of Character Traits
Type requirements charT is either char or wchar_t.
(All of char_traits 's member functions are defined for arbitrary types, but some of char_traits 's members must be explicitly specialized if char_traits is to be useful for other types than char and wchar_t.)
Public base classes None.
Members All of char_traits 's members are static. There is never any reason to create an object of type char_traits.
| Member | Where defined | Description |
char_type | Character Traits | char_traits's value type: charT. |
int_type | Character Traits | char_traits's int type. |
pos_type | Character Traits | char_traits's position type. |
off_type | Character Traits | char_traits's offset type |
state_type | Character Traits | char_traits's state type. |
static void assign(char_type& c1, const char_type& c2) | Character Traits | Assigns c2 to c1. |
static bool eq(const char_type& c1, const char_type& c2) | Character Traits | Character equality. |