X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fflat_map.h;h=c19cc9a09e4a5c5a553e9c07e57910f2a79b8de6;hb=c05f81cac83e80c7727594e3929e0709eccca689;hp=bef1404e43373ed991c684ae4b3421dde5069afd;hpb=c6e40d36b42a7ebf832c3a57d2816a47ee9c9a76;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/flat_map.h b/include/flat_map.h index bef1404e4..c19cc9a09 100644 --- a/include/flat_map.h +++ b/include/flat_map.h @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2019-2020 Sadie Powell * Copyright (C) 2014 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -91,6 +92,10 @@ class flat_map_base { } +#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(); } @@ -200,10 +205,10 @@ class flat_map_base } // namespace detail -template > -class flat_set : public detail::flat_map_base +template , typename ElementComp = Comp> +class flat_set : public detail::flat_map_base { - typedef detail::flat_map_base base_t; + typedef detail::flat_map_base base_t; public: typedef typename base_t::iterator iterator; @@ -222,6 +227,10 @@ class flat_set : public detail::flat_map_base { } +#if __cplusplus >= 201103L + flat_set& operator=(const flat_set& other) = default; +#endif + std::pair insert(const value_type& x) { return this->insert_single(x); @@ -240,10 +249,10 @@ class flat_set : public detail::flat_map_base } }; -template > -class flat_multiset : public detail::flat_map_base +template , typename ElementComp = Comp> +class flat_multiset : public detail::flat_map_base { - typedef detail::flat_map_base base_t; + typedef detail::flat_map_base base_t; public: typedef typename base_t::iterator iterator; @@ -262,6 +271,10 @@ class flat_multiset : public detail::flat_map_base { } +#if __cplusplus >= 201103L + flat_multiset& operator=(const flat_multiset& other) = default; +#endif + iterator insert(const value_type& x) { return this->insert_multi(x); @@ -280,10 +293,10 @@ class flat_multiset : public detail::flat_map_base } }; -template > -class flat_map : public detail::flat_map_base, Comp, T, detail::map_pair_compare, Comp> > +template , typename ElementComp = Comp > +class flat_map : public detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > { - typedef detail::flat_map_base, Comp, T, detail::map_pair_compare, Comp> > base_t; + typedef detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > base_t; public: typedef typename base_t::iterator iterator; @@ -305,6 +318,10 @@ class flat_map : public detail::flat_map_base, Comp, T, detail:: { } +#if __cplusplus >= 201103L + flat_map& operator=(const flat_map& other) = default; +#endif + std::pair insert(const value_type& x) { return this->insert_single(x); @@ -333,10 +350,10 @@ class flat_map : public detail::flat_map_base, Comp, T, detail:: } }; -template > -class flat_multimap : public detail::flat_map_base, Comp, T, detail::map_pair_compare, Comp> > +template , typename ElementComp = Comp > +class flat_multimap : public detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > { - typedef detail::flat_map_base, Comp, T, detail::map_pair_compare, Comp> > base_t; + typedef detail::flat_map_base, Comp, T, detail::map_pair_compare, ElementComp> > base_t; public: typedef typename base_t::iterator iterator; @@ -357,6 +374,10 @@ class flat_multimap : public detail::flat_map_base, Comp, T, det { } +#if __cplusplus >= 201103L + flat_multimap& operator=(const flat_multimap& other) = default; +#endif + iterator insert(const value_type& x) { return this->insert_multi(x);