1 /* Copyright 2016-2017 Joaquin M Lopez Munoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * See http://www.boost.org/libs/poly_collection for library home page.
9 #ifndef BOOST_POLY_COLLECTION_BASE_COLLECTION_HPP
10 #define BOOST_POLY_COLLECTION_BASE_COLLECTION_HPP
16 #include <boost/poly_collection/base_collection_fwd.hpp>
17 #include <boost/poly_collection/detail/base_model.hpp>
18 #include <boost/poly_collection/detail/poly_collection.hpp>
23 namespace poly_collection{
25 template<typename Base,typename Allocator>
26 class base_collection:
27 public common_impl::poly_collection<detail::base_model<Base>,Allocator>
29 using base_type=common_impl::poly_collection<
30 detail::base_model<Base>,Allocator>;
32 base_type& base()noexcept{return *this;}
33 const base_type& base()const noexcept{return *this;}
36 using base_type::base_type;
38 base_collection()=default;
39 base_collection(const base_collection& x)=default;
40 base_collection(base_collection&& x)=default;
41 base_collection& operator=(const base_collection& x)=default;
42 base_collection& operator=(base_collection&& x)=default;
44 template<typename B,typename A>
45 friend bool operator==(
46 const base_collection<B,A>&,const base_collection<B,A>&);
49 template<typename Base,typename Allocator>
51 const base_collection<Base,Allocator>& x,
52 const base_collection<Base,Allocator>& y)
54 return x.base()==y.base();
57 template<typename Base,typename Allocator>
59 const base_collection<Base,Allocator>& x,
60 const base_collection<Base,Allocator>& y)
65 template<typename Base,typename Allocator>
67 base_collection<Base,Allocator>& x,base_collection<Base,Allocator>& y)
74 using poly_collection::base_collection;
76 } /* namespace boost */