32 #ifdef BUILDING_LIB_CS_STRING
33 # define LIB_CS_STRING_EXPORT __declspec(dllexport)
35 # define LIB_CS_STRING_EXPORT __declspec
(dllimport)
39 # define LIB_CS_STRING_EXPORT
43 template <
typename E,
typename A = std::allocator<
typename E::storage_unit>>
54 template <
typename T =
int>
56 : m_char(
static_cast<
unsigned char>(c))
58 #ifndef CS_STRING_ALLOW_UNSAFE
59 static_assert(! std::is_same<T, T>::value,
"Unsafe operations not allowed, unknown encoding for this operation");
73 CsChar(
const CsChar &other)
74 : m_char(other.m_char)
83 auto operator<=>(
const CsChar &other)
const =
default;
85 inline CsChar &operator=(
char c) &;
86 inline CsChar &operator=(
char32_t c) &;
87 inline CsChar &operator=(CsChar c) &;
89 inline uint32_t unicode()
const;
95 inline CsChar &CsChar::operator=(
char c) &
101 inline CsChar &CsChar::operator=(
char32_t c) &
107 inline CsChar &CsChar::operator=(CsChar c) &
113 inline uint32_t CsChar::unicode()
const
122 struct hash<CsString::CsChar>
124 inline size_t operator()(
const CsString::CsChar &key)
const
126 return key.unicode();