File indexing completed on 2025-01-30 09:55:11
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_POLY_COLLECTION_ANY_COLLECTION_HPP
0010 #define BOOST_POLY_COLLECTION_ANY_COLLECTION_HPP
0011
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015
0016 #include <boost/poly_collection/any_collection_fwd.hpp>
0017 #include <boost/poly_collection/detail/any_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 Concept,typename Allocator>
0026 class any_collection:
0027 public common_impl::poly_collection<detail::any_model<Concept>,Allocator>
0028 {
0029 using base_type=common_impl::poly_collection<
0030 detail::any_model<Concept>,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 any_collection()=default;
0039 any_collection(const any_collection& x)=default;
0040 any_collection(any_collection&& x)=default;
0041 any_collection& operator=(const any_collection& x)=default;
0042 any_collection& operator=(any_collection&& x)=default;
0043
0044 template<typename C,typename A>
0045 friend bool operator==(
0046 const any_collection<C,A>&,const any_collection<C,A>&);
0047 };
0048
0049 template<typename Concept,typename Allocator>
0050 bool operator==(
0051 const any_collection<Concept,Allocator>& x,
0052 const any_collection<Concept,Allocator>& y)
0053 {
0054 return x.base()==y.base();
0055 }
0056
0057 template<typename Concept,typename Allocator>
0058 bool operator!=(
0059 const any_collection<Concept,Allocator>& x,
0060 const any_collection<Concept,Allocator>& y)
0061 {
0062 return !(x==y);
0063 }
0064
0065 template<typename Concept,typename Allocator>
0066 void swap(
0067 any_collection<Concept,Allocator>& x,any_collection<Concept,Allocator>& y)
0068 {
0069 x.swap(y);
0070 }
0071
0072 }
0073
0074 using poly_collection::any_collection;
0075
0076 }
0077
0078 #endif