Update std headers

This commit is contained in:
EnderIce2
2023-10-10 06:09:17 +03:00
parent bd04d2bf2f
commit 56358280a7
11 changed files with 1133 additions and 1122 deletions

View File

@ -23,28 +23,28 @@
namespace std
{
template <typename Key>
struct hash
{
size_t operator()(const Key &key) const
{
static_assert(sizeof(size_t) == sizeof(uint64_t)); // size_t and uint64_t must have the same size
const uint64_t fnv_offset_basis = 14695981039346656037ull;
const uint64_t fnv_prime = 1099511628211ull;
template <typename Key>
struct hash
{
size_t operator()(const Key &key) const
{
static_assert(sizeof(size_t) == sizeof(uint64_t)); // size_t and uint64_t must have the same size
const uint64_t fnv_offset_basis = 14695981039346656037ull;
const uint64_t fnv_prime = 1099511628211ull;
const uint8_t *data = reinterpret_cast<const uint8_t *>(&key);
const size_t size = sizeof(Key);
uint64_t ret = fnv_offset_basis;
const uint8_t *data = reinterpret_cast<const uint8_t *>(&key);
const size_t size = sizeof(Key);
uint64_t ret = fnv_offset_basis;
for (size_t i = 0; i < size; ++i)
{
ret ^= static_cast<uint64_t>(data[i]);
ret *= fnv_prime;
}
for (size_t i = 0; i < size; ++i)
{
ret ^= static_cast<uint64_t>(data[i]);
ret *= fnv_prime;
}
return static_cast<size_t>(ret);
}
};
return static_cast<size_t>(ret);
}
};
}
#endif // !__FENNIX_KERNEL_STD_FUNCTIONAL_H__