namespace std { template<> struct char_traits<char> { using char_type = char; using int_type = int; using off_type = streamoff; using pos_type = streampos; using state_type = mbstate_t; static constexpr void assign(char_type& c1, const char_type& c2) noexcept; static constexpr bool eq(char_type c1, char_type c2) noexcept; static constexpr bool lt(char_type c1, char_type c2) noexcept; static constexpr int compare(const char_type* s1, const char_type* s2, size_t n); static constexpr size_t length(const char_type* s); static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a); static char_type* move(char_type* s1, const char_type* s2, size_t n); static char_type* copy(char_type* s1, const char_type* s2, size_t n); static char_type* assign(char_type* s, size_t n, char_type a); static constexpr int_type not_eof(int_type c) noexcept; static constexpr char_type to_char_type(int_type c) noexcept; static constexpr int_type to_int_type(char_type c) noexcept; static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept; static constexpr int_type eof() noexcept; }; }
Определенные типы для int_type, pos_type, off_typeи state_type должно быть int, streampos, streamoffи mbstate_t соответственно.
Типstreampos должен быть типом , определяемым реализацией, который удовлетворяет требованиям pos_type в [iostreams.limits.pos] и [iostream.forward].
Типstreamoff должен быть типом , определяемым реализацией, который удовлетворяет требованиям off_type в [iostreams.limits.pos] и [iostream.forward].
Тип mbstate_t определяется <cwchar> и может представлять любое из состояний преобразования, которое может происходить в определяемом реализацией наборе поддерживаемых правил кодирования многобайтовых символов.
Член с двумя аргументами assign должен быть определен идентично встроенному оператору =. Члены с двумя аргументами eq и lt должны быть определены идентично встроенным операторам == и < типу unsigned char.