From 39ea396e2b962d6361ed11249513d32dbf9b55d3 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 16 May 2022 18:37:39 +0200 Subject: [PATCH] Adds missing documentation. --- src/Collections/StringViewDictionary.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Collections/StringViewDictionary.hpp b/src/Collections/StringViewDictionary.hpp index 386bc18..ef822be 100644 --- a/src/Collections/StringViewDictionary.hpp +++ b/src/Collections/StringViewDictionary.hpp @@ -11,17 +11,24 @@ namespace ArbUt { /// @brief Wrapper around unordered_map, allowing safer access and adding several helper methods. template class StringViewDictionary { public: + /// @brief Custom hash class to allow for accessing values by both StringView and direct hash struct StringViewHash { + /// @brief The actual hash using hash_type = std::hash; + /// @brief As stolen from the documentation using is_transparent = void; - size_t operator()(const char* str) const { return hash_type{}(str); } + /// @brief Support hashing through a StringView size_t operator()(StringView const& str) const { return hash_type{}(str); } + /// @brief Support hashing through the direct hash access. size_t operator()(u32 hash) const { return hash; } }; + /// @brief The underlying std map used using map_type = typename std::unordered_map>; + /// @brief The iterator type of the Dictionary using iterator = typename map_type::iterator; + /// @brief The const iterator type of the Dictionary using const_iterator = typename map_type::const_iterator; private: