From 7bb69bdff8508f17c8bdb18dc7ba0fc7a2dfe0ec Mon Sep 17 00:00:00 2001 From: Dominik Drexler Date: Mon, 23 Dec 2024 12:28:45 +0100 Subject: [PATCH] documentation hash --- include/loki/details/utils/hash.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/loki/details/utils/hash.hpp b/include/loki/details/utils/hash.hpp index 9ca6913..f7ec87a 100644 --- a/include/loki/details/utils/hash.hpp +++ b/include/loki/details/utils/hash.hpp @@ -44,8 +44,10 @@ inline void hash_combine(size_t& seed, const Rest&... rest); template inline size_t hash_combine(const Ts&... rest); -/// @brief `UniquePDDLEqualTo` is used to compare newly created PDDL objects for uniqueness. -/// Since the children are unique, it suffices to create a combined hash from nested pointers. +/// @brief `Hash` is our custom hasher, like std::hash. +/// +/// Forwards to std::hash by default. +/// Specializations can be injected into the namespace. template struct Hash { @@ -53,6 +55,8 @@ struct Hash }; /// @brief Hash specialization for std::set. +/// +/// Combines the hashes of all elements in the set. /// @tparam T template struct Hash> @@ -69,6 +73,8 @@ struct Hash> }; /// @brief Hash specialization for std::vector. +/// +/// Combines the hashes of all elements in the vector. /// @tparam T template struct Hash> @@ -88,6 +94,8 @@ struct Hash> }; /// @brief Hash specialization for a pair. +/// +/// Combines the hashes for first and second. /// @tparam T1 /// @tparam T2 template @@ -97,6 +105,8 @@ struct Hash> }; /// @brief Hash specialization for a tuple. +/// +/// Combines the hashes of all elements in the tuple. /// @tparam ...Ts template struct Hash> @@ -110,6 +120,8 @@ struct Hash> }; /// @brief Hash specialization for a variant. +/// +/// Hashes the underlying object. /// @tparam ...Ts template struct Hash>