Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:47:51

0001 /* Copyright 2016-2017 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/poly_collection for library home page.
0007  */
0008 
0009 #ifndef BOOST_POLY_COLLECTION_BASE_COLLECTION_HPP
0010 #define BOOST_POLY_COLLECTION_BASE_COLLECTION_HPP
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 #include <boost/poly_collection/base_collection_fwd.hpp>
0017 #include <boost/poly_collection/detail/base_model.hpp>
0018 #include <boost/poly_collection/detail/poly_collection.hpp>
0019 #include <utility>
0020 
0021 namespace boost{
0022 
0023 namespace poly_collection{
0024 
0025 template<typename Base,typename Allocator>
0026 class base_collection:
0027  public common_impl::poly_collection<detail::base_model<Base>,Allocator>
0028 {
0029   using base_type=common_impl::poly_collection<
0030     detail::base_model<Base>,Allocator>;
0031 
0032   base_type&       base()noexcept{return *this;}
0033   const base_type& base()const noexcept{return *this;}
0034 
0035 public:
0036   using base_type::base_type;
0037 
0038   base_collection()=default;
0039   base_collection(const base_collection& x)=default;
0040   base_collection(base_collection&& x)=default;
0041   base_collection& operator=(const base_collection& x)=default;
0042   base_collection& operator=(base_collection&& x)=default;
0043    
0044   template<typename B,typename A>
0045   friend bool operator==(
0046     const base_collection<B,A>&,const base_collection<B,A>&);
0047 };
0048 
0049 template<typename Base,typename Allocator>
0050 bool operator==(
0051   const base_collection<Base,Allocator>& x,
0052   const base_collection<Base,Allocator>& y)
0053 {
0054   return x.base()==y.base();
0055 }
0056 
0057 template<typename Base,typename Allocator>
0058 bool operator!=(
0059   const base_collection<Base,Allocator>& x,
0060   const base_collection<Base,Allocator>& y)
0061 {
0062  return !(x==y);
0063 }
0064 
0065 template<typename Base,typename Allocator>
0066 void swap(
0067   base_collection<Base,Allocator>& x,base_collection<Base,Allocator>& y)
0068 {
0069   x.swap(y);
0070 }
0071 
0072 } /* namespace  */
0073 
0074 using poly_collection::base_collection;
0075 
0076 } /* namespace boost */
0077 
0078 #endif