summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-02-19 18:22:00 +0000
committerPeter Powell <petpow@saberuk.com>2019-02-19 20:58:53 +0000
commitf06502606e6e043487d9154ce4127e81e1181549 (patch)
tree0893e104e0133c1517daf6299a43c0dcb2a0eae4
parent7d84771f49973d7091789a8b5f0f6295d288a673 (diff)
Allow customising ElementComp in flat_{map,multimap,multiset,set}.
-rw-r--r--include/flat_map.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/flat_map.h b/include/flat_map.h
index bef1404e4..62815168b 100644
--- 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;