From 9d5d4f0338d32864339a752ee6d2ffc143a4db94 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 24 Jun 2021 00:23:30 +0000 Subject: [PATCH] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index f2b8ef7..9088bb3 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,23 @@ auto generate_random() -> T ```cpp template 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 make(const T& data) + { + auto hash = std::hash>{}(data, llo::utils::generate_random()); + + return std::make_shared(data, hash); + } + + T& get_data() const; + std::size_t get_hash() const; +}; ```