20 HashCache(T value) noexcept : _value(std::move(value))
22 using Hasher =
typename std::hash<T>;
23 _hash = Hasher()(_value);
34 _value = other._value;
38 void operator=(
HashCache&& other) noexcept { other.swap(*
this); }
42 std::swap(this->_value, other._value);
43 std::swap(this->_hash, other._hash);
46 const T& value()
const {
return _value; }
47 std::size_t hash()
const {
return _hash; }
49 operator T() {
return _value; }
53 return a._hash == b._hash && a._value == b._value;
58 return a._hash != b._hash || a._value != b._value;
66 template<
typename Hasher>
74 return hasher(x.value());
Definition: hash_cache.hpp:67
Definition: hash_cache.hpp:17
Definition: coroutine.hpp:18