Update README.md

master
_xeroxz 3 years ago
parent 2054627424
commit 9d5d4f0338

@ -20,4 +20,23 @@ auto generate_random() -> T
```cpp ```cpp
template <class T> template <class T>
class T hash_t class T hash_t
{
hash_t hash(const T& data, std::size_t hash_result)
: data {&data}, hash_result{hash_result}
{}
std::size_t hash_result;
const T* data;
public:
static std::shared_ptr<hash_t> make(const T& data)
{
auto hash = std::hash<std::varient<T, std::uint64_t>>{}(data, llo::utils::generate_random<std::uint64_t>());
return std::make_shared<hash_t>(data, hash);
}
T& get_data() const;
std::size_t get_hash() const;
};
``` ```

Loading…
Cancel
Save