/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2019-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
{
}
+#if __cplusplus >= 201103L
+ flat_map_base& operator=(const flat_map_base& other) = default;
+#endif
+
size_type size() const { return vect.size(); }
bool empty() const { return vect.empty(); }
size_type capacity() const { return vect.capacity(); }
} // 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;
{
}
+#if __cplusplus >= 201103L
+ flat_set& operator=(const flat_set& other) = default;
+#endif
+
std::pair<iterator, bool> insert(const value_type& x)
{
return this->insert_single(x);
}
};
-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;
{
}
+#if __cplusplus >= 201103L
+ flat_multiset& operator=(const flat_multiset& other) = default;
+#endif
+
iterator insert(const value_type& x)
{
return this->insert_multi(x);
}
};
-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;
{
}
+#if __cplusplus >= 201103L
+ flat_map& operator=(const flat_map& other) = default;
+#endif
+
std::pair<iterator, bool> insert(const value_type& x)
{
return this->insert_single(x);
}
};
-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;
{
}
+#if __cplusplus >= 201103L
+ flat_multimap& operator=(const flat_multimap& other) = default;
+#endif
+
iterator insert(const value_type& x)
{
return this->insert_multi(x);