Skip to content

Commit

Permalink
Update string_map.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Nov 25, 2023
1 parent 984fbca commit 2820d86
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/core/inc/tactile/core/container/string_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@

namespace tactile {

/**
* \brief Custom hash object capable of hashing different string types.
*/
struct StringHash final {
using hash_type = std::hash<StringView>;
using is_transparent = std::true_type;
using is_transparent [[maybe_unused]] = std::true_type;

[[nodiscard]] auto operator()(const char* str) const -> usize
{
Expand All @@ -32,7 +35,9 @@ struct StringHash final {
}
};

/** Variant of hash map optimized for string keys, using heterogeneous lookups. */
/**
* \brief Variant of hash map optimized for string keys, using heterogeneous lookups.
*/
template <typename T>
using StringMap = std::unordered_map<String, T, StringHash, std::equal_to<>>;

Expand Down

0 comments on commit 2820d86

Please sign in to comment.