inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit f06502606e6e043487d9154ce4127e81e1181549
parent 7d84771f49973d7091789a8b5f0f6295d288a673
Author: Peter Powell <petpow@saberuk.com>
Date:   Tue, 19 Feb 2019 18:22:00 +0000

Allow customising ElementComp in flat_{map,multimap,multiset,set}.

Diffstat:
Minclude/flat_map.h | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/flat_map.h b/include/flat_map.h @@ -200,10 +200,10 @@ class flat_map_base } // namespace detail -template <typename T, typename Comp = std::less<T> > -class flat_set : public detail::flat_map_base<T, Comp> +template <typename T, typename Comp = std::less<T>, typename ElementComp = Comp> +class flat_set : public detail::flat_map_base<T, Comp, T, ElementComp> { - typedef detail::flat_map_base<T, Comp> base_t; + typedef detail::flat_map_base<T, Comp, T, ElementComp> base_t; public: typedef typename base_t::iterator iterator; @@ -240,10 +240,10 @@ class flat_set : public detail::flat_map_base<T, Comp> } }; -template <typename T, typename Comp = std::less<T> > -class flat_multiset : public detail::flat_map_base<T, Comp> +template <typename T, typename Comp = std::less<T>, typename ElementComp = Comp> +class flat_multiset : public detail::flat_map_base<T, Comp, T, ElementComp> { - typedef detail::flat_map_base<T, Comp> base_t; + typedef detail::flat_map_base<T, Comp, T, ElementComp> base_t; public: typedef typename base_t::iterator iterator; @@ -280,10 +280,10 @@ class flat_multiset : public detail::flat_map_base<T, Comp> } }; -template <typename T, typename U, typename Comp = std::less<T> > -class flat_map : public detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, Comp> > +template <typename T, typename U, typename Comp = std::less<T>, typename ElementComp = Comp > +class flat_map : public detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, ElementComp> > { - typedef detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, Comp> > base_t; + typedef detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, ElementComp> > base_t; public: typedef typename base_t::iterator iterator; @@ -333,10 +333,10 @@ class flat_map : public detail::flat_map_base<std::pair<T, U>, Comp, T, detail:: } }; -template <typename T, typename U, typename Comp = std::less<T> > -class flat_multimap : public detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, Comp> > +template <typename T, typename U, typename Comp = std::less<T>, typename ElementComp = Comp > +class flat_multimap : public detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, ElementComp> > { - typedef detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, Comp> > base_t; + typedef detail::flat_map_base<std::pair<T, U>, Comp, T, detail::map_pair_compare<std::pair<T, U>, ElementComp> > base_t; public: typedef typename base_t::iterator iterator;