diff --git a/libs/util/include/psemek/util/hash_table.hpp b/libs/util/include/psemek/util/hash_table.hpp index 2de28b0e..1c975352 100644 --- a/libs/util/include/psemek/util/hash_table.hpp +++ b/libs/util/include/psemek/util/hash_table.hpp @@ -373,17 +373,14 @@ namespace psemek::util : Hash(hash) {} - std::size_t operator()(Key const & key) const + template + std::size_t operator()(Key1 const & key) const { return static_cast(*this)(key); } - std::size_t operator()(std::pair const & pair) const - { - return static_cast(*this)(pair.first); - } - - std::size_t operator()(std::pair const & pair) const + template + std::size_t operator()(std::pair const & pair) const { return static_cast(*this)(pair.first); } @@ -397,22 +394,20 @@ namespace psemek::util : Equal(equal) {} - bool operator()(Key const & key1, std::pair const & pair2) const + template + bool operator()(Key1 const & key1, std::pair const & pair2) const { return static_cast(*this)(key1, pair2.first); } - bool operator()(std::pair const & pair1, Key const & key2) const + template + bool operator()(std::pair const & pair1, Key2 const & key2) const { return static_cast(*this)(pair1.first, key2); } - bool operator()(std::pair const & pair1, std::pair const & pair2) const - { - return static_cast(*this)(pair1.first, pair2.first); - } - - bool operator()(std::pair const & pair1, std::pair const & pair2) const + template + bool operator()(std::pair const & pair1, std::pair const & pair2) const { return static_cast(*this)(pair1.first, pair2.first); } @@ -644,7 +639,7 @@ namespace psemek::util { auto it = find(key); if (it == end()) - throw util::key_error{key}; + throw util::key_error(key); return it->second; } @@ -653,7 +648,7 @@ namespace psemek::util { auto it = find(key); if (it == end()) - throw util::key_error{key}; + throw util::key_error(key); return it->second; } @@ -661,7 +656,7 @@ namespace psemek::util { auto it = find(key); if (it == end()) - throw util::key_error{key}; + throw util::key_error(key); return it->second; } @@ -670,7 +665,7 @@ namespace psemek::util { auto it = find(key); if (it == end()) - throw util::key_error{key}; + throw util::key_error(key); return it->second; }