Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::char_traits<char>::to_char_type, std::char_traits<wchar_t>::to_char_type, std::char_traits<char8_t>::to_char_type, std::char_traits<char16_t>::to_char_type, std::char_traits<char32_t>::to_char_type

Converts c to char_type. If there is no equivalent char_type value (such as when c is a copy of the eof() value), the result is unspecified.

NotebookLM
static char_type to_char_type( int_type c );
(constexpr since C++11)
(noexcept since C++11)

Converts c to char_type. If there is no equivalent char_type value (such as when c is a copy of the eof() value), the result is unspecified.

See CharTraits for the general requirements on character traits for X::to_char_type.

Parameters

c - value to convert

Return value

A value equivalent to c.

Complexity

Constant.

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.