다음을 통해 공유


char_traits 구조체

The char_traits struct describes attributes associated with a character.

template <
   class CharType
> struct char_traits;

매개 변수

  • CharType
    The element data type.

설명

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.

형식 정의

char_type

A type of character.

int_type

An integer type that can represent a character of type char_type or an end-of-file (EOF) character.

off_type

An integer type that can represent offsets between positions in a stream.

pos_type

An integer type that can represent positions in a stream.

state_type

A type that represents the conversion state in for multibyte characters in a stream.

멤버 함수

assign

Assigns one character value to another.

compare

Compares up to a specified number of characters in two strings.

copy

Copies a specified number of characters from one string to another. 사용되지 않습니다. 대신 char_traits::_Copy_s를 사용하십시오.

_Copy_s

Copies a specified number of characters from one string to another.

eof

Returns the end-of-file (EOF) character.

eq

Tests whether two char_type characters are equal.

eq_int_type

Tests whether two characters represented as int_types are equal.

find

Searches for the first occurrence of a specified character in a range of characters.

length

문자열의 길이를 반환합니다.

lt

Tests whether one character is less than another.

move

Copies a specified number of characters in a sequence to another, possible overlapping, sequence. 사용되지 않습니다. 대신 char_traits::_Move_s를 사용하십시오.

_Move_s

Copies a specified number of characters in a sequence to another, possible overlapping, sequence.

not_eof

Tests whether a character is the end-of-file (EOF) character.

to_char_type

Converts an int_type character to the corresponding char_type character and returns the result.

to_int_type

Converts a char_type character to the corresponding int_type character and returns the result.

요구 사항

헤더: <string>

네임스페이스: std

참고 항목

참조

C++ 표준 라이브러리의 스레드 보안

기타 리소스

char_traits 멤버

<string> 멤버