__GNU_CXX::CHAR_TRAITS(3cxx)

πŸ’– __gnu_cxx::char_traits< _CharT > β€” manual section 3cxx πŸ’–

✨ NAME ✨

okay so bestie, this page is for __gnu_cxx::char_traits< _CharT >, and the NAME tea is: Base class used to implement std::char_traits. That’s the whole assignment, no cap. πŸ’…

🌸 SYNOPSIS 🌸

#include <char_traits.h>

It’s inherited by std::char_traits< _CharT >. Slay.

πŸŽ€ Public Types πŸŽ€

  • typedef _CharT char_type β€” the character type itself, literally.
  • using comparison_category = std::strong_ordering β€” the comparison category alias, exactly as written.
  • typedef _Char_types< _CharT >::int_type int_type β€” the int_type alias from _Char_types< _CharT >.
  • typedef _Char_types< _CharT >::off_type off_type β€” the off_type alias from _Char_types< _CharT >.
  • typedef _Char_types< _CharT >::pos_type pos_type β€” the pos_type alias from _Char_types< _CharT >.
  • typedef _Char_types< _CharT >::state_type state_type β€” the state_type alias from _Char_types< _CharT >.

🫢 Static Public Member Functions 🫢

  • assign (reference version) β€” static constexpr void assign (char_type &__c1, const char_type &__c2)
  • assign (pointer version) β€” static constexpr char_type * assign (char_type *__s, std::size_t __n, char_type __a)
  • compare β€” static constexpr int compare (const char_type *__s1, const char_type *__s2, std::size_t __n)
  • copy β€” static constexpr char_type * copy (char_type *__s1, const char_type *__s2, std::size_t __n)
  • eq β€” static constexpr bool eq (const char_type &__c1, const char_type &__c2)
  • eq_int_type β€” static constexpr bool eq_int_type (const int_type &__c1, const int_type &__c2)
  • find β€” static constexpr const char_type * find (const char_type *__s, std::size_t __n, const char_type &__a)
  • length β€” static constexpr std::size_t length (const char_type *__s)
  • lt β€” static constexpr bool lt (const char_type &__c1, const char_type &__c2)
  • move β€” static constexpr char_type * move (char_type *__s1, const char_type *__s2, std::size_t __n)
  • to_char_type β€” static constexpr char_type to_char_type (const int_type &__c)
  • to_int_type β€” static constexpr int_type to_int_type (const char_type &__c)

πŸ”₯ Detailed Description πŸ”₯

template<typename _CharT>
struct __gnu_cxx::char_traits< _CharT >

This is the β€œBase class used to implement std::char_traits.” It’s giving foundational, main-character energy, but for character traits. πŸ‘‘

πŸ’€ Note πŸ’€

Note: For any given actual character type, this definition is probably wrong. (Most of the member functions are likely to be right, but the int_type and state_type typedefs, and the eof() member function, are likely to be wrong.) The reason this class exists is so users can specialize it. Classes in namespace std may not be specialized for fundamental types, but classes in namespace __gnu_cxx may be.

πŸ¦‹ See πŸ¦‹

https://gcc.gnu.org/onlinedocs/libstdc++/manual/strings.html#strings.string.character_types for advice on how to make use of this class for unusual character types. Also, check out include/ext/pod_char_traits.h. 🫢

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. (No cap, that’s the actual author line.) πŸ’–


sign-off: source/version is libstdc++ / manual section 3cxx; date: not printed in the original footer text, so I’m not inventing one, bestie. mwah πŸ’‹ 🫢

πŸ“¦ where this page comes from