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