◐ Shell
clean mode source ↗

std::char_traits<CharT>::to_int_type - cppreference.com

<tbody> </tbody> <tbody class="t-dcl-rev "> </tbody><tbody> </tbody>

static int_type to_int_type( char_type c );

(C++11未満)

static constexpr int_type to_int_type( char_type c ) noexcept;

(C++11以上)

char_type の値を int_type に変換します。

引数

c - 変換する値

戻り値

c と同等な値。

計算量

一定。

ノート

すべての有効な char_type の値について、 eof() と異なる一意な int_type の値が存在しなければなりません。 例えば、 char_traits<char>::eof() の一般的な実装は return -1 を返し、対応する char_traits<char>::to_int_type(c) の有効な実装は return (unsigned char)c を返します。