File indexing completed on 2025-01-18 09:41:37
0001
0002 #ifndef BOOST_MPL_AUX_BEGIN_END_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_BEGIN_END_IMPL_HPP_INCLUDED
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <boost/mpl/begin_end_fwd.hpp>
0018 #include <boost/mpl/sequence_tag_fwd.hpp>
0019 #include <boost/mpl/void.hpp>
0020 #include <boost/mpl/eval_if.hpp>
0021 #include <boost/mpl/aux_/has_begin.hpp>
0022 #include <boost/mpl/aux_/na.hpp>
0023 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
0024 #include <boost/mpl/aux_/config/eti.hpp>
0025
0026 namespace boost { namespace mpl {
0027
0028
0029 namespace aux {
0030
0031 template< typename Sequence >
0032 struct begin_type
0033 {
0034 typedef typename Sequence::begin type;
0035 };
0036 template< typename Sequence >
0037 struct end_type
0038 {
0039 typedef typename Sequence::end type;
0040 };
0041
0042 }
0043
0044
0045
0046
0047
0048 template< typename Tag >
0049 struct begin_impl
0050 {
0051 template< typename Sequence > struct apply
0052 {
0053 typedef typename eval_if<aux::has_begin<Sequence, true_>,
0054 aux::begin_type<Sequence>, void_>::type type;
0055 };
0056 };
0057
0058 template< typename Tag >
0059 struct end_impl
0060 {
0061 template< typename Sequence > struct apply
0062 {
0063 typedef typename eval_if<aux::has_begin<Sequence, true_>,
0064 aux::end_type<Sequence>, void_>::type type;
0065 };
0066 };
0067
0068
0069
0070 # define AUX778076_IMPL_SPEC(name, tag, result) \
0071 template<> \
0072 struct name##_impl<tag> \
0073 { \
0074 template< typename Sequence > struct apply \
0075 { \
0076 typedef result type; \
0077 }; \
0078 }; \
0079
0080
0081
0082 AUX778076_IMPL_SPEC(begin, nested_begin_end_tag, typename Sequence::begin)
0083 AUX778076_IMPL_SPEC(end, nested_begin_end_tag, typename Sequence::end)
0084
0085
0086
0087
0088 AUX778076_IMPL_SPEC(begin, non_sequence_tag, void_)
0089 AUX778076_IMPL_SPEC(end, non_sequence_tag, void_)
0090 AUX778076_IMPL_SPEC(begin, na, void_)
0091 AUX778076_IMPL_SPEC(end, na, void_)
0092
0093 # undef AUX778076_IMPL_SPEC
0094
0095
0096 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,begin_impl)
0097 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,end_impl)
0098
0099 }}
0100
0101 #endif