31 #ifdef BUILDING_LIB_CS_STRING
32 # define LIB_CS_STRING_EXPORT __declspec(dllexport)
34 # define LIB_CS_STRING_EXPORT __declspec
(dllimport)
38 # define LIB_CS_STRING_EXPORT
42 template <
typename E,
typename A = std::allocator<
typename E::storage_unit>>
53 template <
typename T =
int>
55 : m_char(
static_cast<
unsigned char>(c))
57 #ifndef CS_STRING_ALLOW_UNSAFE
58 static_assert(! std::is_same<T, T>::value,
"Unsafe operations not allowed, unknown encoding for this operation");
72 CsChar(
const CsChar &other)
73 : m_char(other.m_char)
86 inline bool operator!=(
const CsChar &other)
const;
87 inline bool operator==(
const CsChar &other)
const;
89 inline bool operator<(
const CsChar &other)
const;
90 inline bool operator<=(
const CsChar &other)
const;
91 inline bool operator>(
const CsChar &other)
const;
92 inline bool operator>=(
const CsChar &other)
const;
94 inline CsChar &operator=(
char c) &;
95 inline CsChar &operator=(
char32_t c) &;
96 inline CsChar &operator=(CsChar c) &;
98 inline uint32_t unicode()
const;
105 inline bool CsChar::operator!=(
const CsChar &other)
const
107 return m_char != other.m_char;
110 inline bool CsChar::operator==(
const CsChar &other)
const
112 return m_char == other.m_char;
115 inline bool CsChar::operator<(
const CsChar &other)
const
117 return m_char < other.m_char;
120 inline bool CsChar::operator<=(
const CsChar &other)
const
122 return m_char <= other.m_char;
125 inline bool CsChar::operator>(
const CsChar &other)
const
127 return m_char > other.m_char;
130 inline bool CsChar::operator>=(
const CsChar &other)
const
132 return m_char >= other.m_char;
135 inline CsChar &CsChar::operator=(
char c) &
141 inline CsChar &CsChar::operator=(
char32_t c) &
147 inline CsChar &CsChar::operator=(CsChar c) &
153 inline uint32_t CsChar::unicode()
const
162 struct hash<CsString::CsChar>
164 inline size_t operator()(
const CsString::CsChar &key)
const
166 return key.unicode();