fixed indentation for uuid class
This commit is contained in:
parent
920fdc68ed
commit
40dfc30dae
|
|
@ -6,7 +6,6 @@
|
|||
#include <cstdint>
|
||||
|
||||
namespace matador::utils {
|
||||
|
||||
class uuid {
|
||||
public:
|
||||
using uuid_array = std::array<uint32_t, 4>;
|
||||
|
|
@ -39,13 +38,7 @@ private:
|
|||
// Hash specialization to allow use in unordered containers
|
||||
template<>
|
||||
struct std::hash<matador::utils::uuid> {
|
||||
std::size_t operator()(const matador::utils::uuid& u) const noexcept {
|
||||
std::size_t h = 0;
|
||||
for (const uint32_t val : u.data()) {
|
||||
h ^= std::hash<uint32_t>{}(val) + 0x9e3779b9 + (h << 6) + (h >> 2);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
std::size_t operator()(const matador::utils::uuid &u) const noexcept;
|
||||
};
|
||||
|
||||
#endif //MATADOR_UUID_HPP
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <random>
|
||||
|
||||
namespace matador::utils {
|
||||
|
||||
uuid uuid::generate() {
|
||||
std::random_device rd;
|
||||
std::mt19937_64 gen(rd());
|
||||
|
|
@ -73,3 +72,11 @@ bool operator<( const uuid& lhs, const uuid& rhs ) {
|
|||
return lhs._data < rhs._data;
|
||||
}
|
||||
}
|
||||
|
||||
std::size_t std::hash<matador::utils::uuid>::operator()(const matador::utils::uuid &u) const noexcept {
|
||||
std::size_t h = 0;
|
||||
for (const uint32_t val: u.data()) {
|
||||
h ^= std::hash<uint32_t>{}(val) + 0x9e3779b9 + (h << 6) + (h >> 2);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue