Adds missing documentation.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
eec26f2c12
commit
39ea396e2b
|
@ -11,17 +11,24 @@ namespace ArbUt {
|
||||||
/// @brief Wrapper around unordered_map, allowing safer access and adding several helper methods.
|
/// @brief Wrapper around unordered_map, allowing safer access and adding several helper methods.
|
||||||
template <class ValueT> class StringViewDictionary {
|
template <class ValueT> class StringViewDictionary {
|
||||||
public:
|
public:
|
||||||
|
/// @brief Custom hash class to allow for accessing values by both StringView and direct hash
|
||||||
struct StringViewHash {
|
struct StringViewHash {
|
||||||
|
/// @brief The actual hash
|
||||||
using hash_type = std::hash<StringView>;
|
using hash_type = std::hash<StringView>;
|
||||||
|
/// @brief As stolen from the documentation
|
||||||
using is_transparent = void;
|
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); }
|
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; }
|
size_t operator()(u32 hash) const { return hash; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @brief The underlying std map used
|
||||||
using map_type = typename std::unordered_map<StringView, ValueT, StringViewHash, std::equal_to<>>;
|
using map_type = typename std::unordered_map<StringView, ValueT, StringViewHash, std::equal_to<>>;
|
||||||
|
/// @brief The iterator type of the Dictionary
|
||||||
using iterator = typename map_type::iterator;
|
using iterator = typename map_type::iterator;
|
||||||
|
/// @brief The const iterator type of the Dictionary
|
||||||
using const_iterator = typename map_type::const_iterator;
|
using const_iterator = typename map_type::const_iterator;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue