char_traits Struct
The char_traits struct describes attributes associated with a character.
template <
class CharType
> struct char_traits;
Parameters
- CharType
The element data type.
Remarks
The template struct describes various character traits for type CharType. The template class basic_string as well as several iostream template classes, including basic_ios, use this information to manipulate elements of type CharType. Such an element type must not require explicit construction or destruction. It must supply a default constructor, a copy constructor, and an assignment operator, with the expected semantics. A bitwise copy must have the same effect as an assignment. None of the member functions of struct char_traits can throw exceptions.
Typedefs
A type of character. |
|
An integer type that can represent a character of type char_type or an end-of-file (EOF) character. |
|
An integer type that can represent offsets between positions in a stream. |
|
An integer type that can represent positions in a stream. |
|
A type that represents the conversion state in for multibyte characters in a stream. |
Member Functions
Assigns one character value to another. |
|
Compares up to a specified number of characters in two strings. |
|
Copies a specified number of characters from one string to another. Deprecated. Use char_traits::_Copy_s instead. |
|
Copies a specified number of characters from one string to another. |
|
Returns the end-of-file (EOF) character. |
|
Tests whether two char_type characters are equal. |
|
Tests whether two characters represented as int_types are equal. |
|
Searches for the first occurrence of a specified character in a range of characters. |
|
Returns the length of a string. |
|
Tests whether one character is less than another. |
|
Copies a specified number of characters in a sequence to another, possible overlapping, sequence. Deprecated. Use char_traits::_Move_s instead. |
|
Copies a specified number of characters in a sequence to another, possible overlapping, sequence. |
|
Tests whether a character is the end-of-file (EOF) character. |
|
Converts an int_type character to the corresponding char_type character and returns the result. |
|
Converts a char_type character to the corresponding int_type character and returns the result. |
Requirements
Header: <string>
Namespace: std