Fixes iterator over StringViewDictionary
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2022-05-16 17:07:47 +02:00
parent dd2169bb02
commit f8ba0b32b6
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 6 additions and 7 deletions

View File

@ -20,10 +20,11 @@ namespace ArbUt {
size_t operator()(u32 hash) const { return hash; } size_t operator()(u32 hash) const { return hash; }
}; };
std::unordered_map<StringView, ValueT, StringViewHash, std::equal_to<>> _map; using map_type = typename std::unordered_map<StringView, ValueT, StringViewHash, std::equal_to<>>;
map_type _map;
using iterator = typename std::unordered_map<StringView, ValueT>::iterator; using iterator = typename map_type::iterator;
using const_iterator = typename std::unordered_map<StringView, ValueT>::const_iterator; using const_iterator = typename map_type::const_iterator;
public: public:
/// @brief The type used for the indexer of the dictionary. /// @brief The type used for the indexer of the dictionary.
@ -137,11 +138,9 @@ namespace ArbUt {
const_iterator end() const { return _map.end(); } const_iterator end() const { return _map.end(); }
/// @brief returns the backing unordered_map. /// @brief returns the backing unordered_map.
const std::unordered_map<StringView, ValueT, StringViewHash, std::equal_to<>>& GetStdMap() const noexcept { const map_type& GetStdMap() const noexcept { return _map; }
return _map;
}
/// @brief returns the backing unordered_map. /// @brief returns the backing unordered_map.
std::unordered_map<StringView, ValueT, StringViewHash, std::equal_to<>>& GetStdMap() noexcept { return _map; } map_type& GetStdMap() noexcept { return _map; }
}; };
} }