File indexing completed on 2025-01-18 09:29:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_FUNCTOR_BAG_HPP
0013 #define BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_FUNCTOR_BAG_HPP
0014
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018
0019 #include <boost/config.hpp>
0020
0021 #if defined(BOOST_MSVC)
0022
0023
0024
0025 # pragma warning(push)
0026 # pragma warning(disable:4181)
0027
0028 #endif
0029
0030 #include <boost/mpl/placeholders.hpp>
0031
0032 #include <boost/type_traits/add_reference.hpp>
0033 #include <boost/type_traits/is_base_of.hpp>
0034
0035 #include <boost/mpl/inherit_linearly.hpp>
0036 #include <boost/mpl/inherit.hpp>
0037
0038 namespace boost {
0039 namespace bimaps {
0040 namespace container_adaptor {
0041 namespace detail {
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 template < class Data, class FunctorList >
0052 struct data_with_functor_bag :
0053
0054 public mpl::inherit_linearly<
0055
0056 FunctorList,
0057 mpl::if_< is_base_of< mpl::_2, mpl::_1 >,
0058
0059 mpl::_1,
0060
0061
0062
0063 mpl::inherit< mpl::_1, mpl::_2 >
0064
0065 >
0066
0067 >::type
0068 {
0069 Data data;
0070
0071 data_with_functor_bag() {}
0072
0073 data_with_functor_bag(BOOST_DEDUCED_TYPENAME add_reference<Data>::type d)
0074 : data(d) {}
0075
0076 template< class Functor >
0077 Functor& functor()
0078 {
0079 return *(static_cast<Functor*>(this));
0080 }
0081
0082 template< class Functor >
0083 const Functor& functor() const
0084 {
0085 return *(static_cast<Functor const *>(this));
0086 }
0087 };
0088
0089 }
0090 }
0091 }
0092 }
0093
0094 #if defined(BOOST_MSVC)
0095 # pragma warning(pop)
0096 #endif
0097
0098 #endif
0099
0100