From fdd9227b232db9aae9bc4b2c60ca4de2cdaa0b54 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 23 Jul 2017 23:32:20 +0200 Subject: Core/Misc: Util changes * Move IteratorPair to its own header * Add AsUnderlyingType function to cast enum value to its underlying type (avoids repeating std::underlying_type everywhere) --- src/common/Utilities/Containers.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/common/Utilities/Containers.h') diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index a2b42011bd8..dea76ce58bb 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -186,31 +186,6 @@ namespace Trinity return itr != map.end() ? AddressOrSelf(itr->second) : nullptr; } - /** - * @class IteratorPair - * - * @brief Utility class to enable range for loop syntax for multimap.equal_range uses - */ - template - class IteratorPair - { - public: - IteratorPair() : _iterators() { } - IteratorPair(std::pair iterators) : _iterators(iterators) { } - - iterator begin() const { return _iterators.first; } - iterator end() const { return _iterators.second; } - - private: - std::pair _iterators; - }; - - template - inline auto MapEqualRange(M& map, typename M::key_type const& key) -> IteratorPair - { - return { map.equal_range(key) }; - } - template class M, class... Rest> void MultimapErasePair(M& multimap, K const& key, V const& value) { -- cgit v1.2.3