17 #ifndef COM_BORA_SOFTWARE__BALAU_TYPE__STD_TYPES 18 #define COM_BORA_SOFTWARE__BALAU_TYPE__STD_TYPES 21 #include <Balau/BalauConfig.hpp> 106 #pragma clang diagnostic push 107 #pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection" 122 static_assert(CHAR_BIT == 8,
"char size is not 8 bits");
124 static_assert(
sizeof(
signed char) == 1,
"signed char size is not 8 bits");
125 static_assert(
sizeof(
signed short) == 2,
"signed short size is not 16 bits");
126 static_assert(
sizeof(
signed int) == 4,
"signed int size is not 32 bits");
127 static_assert(
sizeof(
signed long long) == 8,
"signed long long size is not 64 bits");
129 static_assert(
sizeof(
unsigned char) == 1,
"unsigned char size is not 8 bits");
130 static_assert(
sizeof(
unsigned short) == 2,
"unsigned short size is not 16 bits");
131 static_assert(
sizeof(
unsigned int) == 4,
"unsigned int size is not 32 bits");
132 static_assert(
sizeof(
unsigned long long) == 8,
"unsigned long long size is not 64 bits");
134 static_assert(
sizeof(int8_t) == 1,
"int8_t is not 8 bits");
135 static_assert(
sizeof(int16_t) == 2,
"int16_t is not 16 bits");
136 static_assert(
sizeof(int32_t) == 4,
"int32_t is not 32 bits");
137 static_assert(
sizeof(int64_t) == 8,
"int64_t is not 64 bits");
139 static_assert(
sizeof(uint8_t) == 1,
"uint8_t is not 8 bits");
140 static_assert(
sizeof(uint16_t) == 2,
"uint16_t is not 16 bits");
141 static_assert(
sizeof(uint32_t) == 4,
"uint32_t is not 32 bits");
142 static_assert(
sizeof(uint64_t) == 8,
"uint64_t is not 64 bits");
146 #if INTPTR_MAX == INT32_MAX 147 #define BalauPointerSize_ 32 148 #elif INTPTR_MAX == INT64_MAX 149 #define BalauPointerSize_ 64 151 #error "Pointer size not supported for this platform." 157 #define BalauPointerSize BalauPointerSize_ 161 #ifdef BALAU_USE_BOOST_STRING_VIEW 162 #include <Balau/Type/Impl/StringView.hpp> 164 #include <string_view> 187 using u16istream = basic_istream<char16_t>;
188 using u16ostream = basic_ostream<char16_t>;
190 using u16ifstream = basic_ifstream<char16_t>;
191 using u16ofstream = basic_ofstream<char16_t>;
193 using u16istringstream = basic_istringstream<char16_t>;
194 using u16ostringstream = basic_ostringstream<char16_t>;
196 using u32istream = basic_istream<char32_t>;
197 using u32ostream = basic_ostream<char32_t>;
199 using u32ifstream = basic_ifstream<char32_t>;
200 using u32ofstream = basic_ofstream<char32_t>;
202 using u32istringstream = basic_istringstream<char32_t>;
203 using u32ostringstream = basic_ostringstream<char32_t>;
207 template <
typename T>
struct hash<const vector<T>> {
208 size_t operator () (
const vector<T> & vector)
const noexcept {
209 hash<T> elementHashFunction;
211 size_t h = vector.size();
212 for (
auto & element : vector) {
213 h ^= elementHashFunction(element) + 0x9e3779b9 + (h << 6U) + (h >> 2U);
220 template <>
struct hash<char *> {
221 size_t operator () (
char *
const & ptr)
const noexcept {
222 return (((
size_t) ptr) >> 6U) * 31U;
226 template <
typename T>
struct equal_to<vector<T>> {
227 bool operator () (
const vector<T> & lhs,
const vector<T> & rhs)
const {
228 if (lhs.size() != rhs.size()) {
232 for (
size_t m = 0; m < lhs.size(); m++) {
233 if (!equal_to(lhs[m], rhs[m])) {
244 #pragma clang diagnostic pop 246 #endif // COM_BORA_SOFTWARE__BALAU_TYPE__STD_TYPES
void _Balau_SwallowSemiColon_()
Empty inline function that is used to force a semicolon at the end of a macro and to prevent empty st...
Definition: StdTypes.hpp:179
const std::string BalauVersion
The version of the Balau library.