From f8ba0b32b6739b276ddfa5323d773523f3cf8bbf Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 16 May 2022 17:07:47 +0200 Subject: [PATCH] Fixes iterator over StringViewDictionary --- src/Collections/StringViewDictionary.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Collections/StringViewDictionary.hpp b/src/Collections/StringViewDictionary.hpp index 36a6969..5cbba4d 100644 --- a/src/Collections/StringViewDictionary.hpp +++ b/src/Collections/StringViewDictionary.hpp @@ -20,10 +20,11 @@ namespace ArbUt { size_t operator()(u32 hash) const { return hash; } }; - std::unordered_map> _map; + using map_type = typename std::unordered_map>; + map_type _map; - using iterator = typename std::unordered_map::iterator; - using const_iterator = typename std::unordered_map::const_iterator; + using iterator = typename map_type::iterator; + using const_iterator = typename map_type::const_iterator; public: /// @brief The type used for the indexer of the dictionary. @@ -137,11 +138,9 @@ namespace ArbUt { const_iterator end() const { return _map.end(); } /// @brief returns the backing unordered_map. - const std::unordered_map>& GetStdMap() const noexcept { - return _map; - } + const map_type& GetStdMap() const noexcept { return _map; } /// @brief returns the backing unordered_map. - std::unordered_map>& GetStdMap() noexcept { return _map; } + map_type& GetStdMap() noexcept { return _map; } }; }