123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef BOOST_MPL_AUX_BEGIN_END_IMPL_HPP_INCLUDED
- #define BOOST_MPL_AUX_BEGIN_END_IMPL_HPP_INCLUDED
- #include <boost/mpl/begin_end_fwd.hpp>
- #include <boost/mpl/sequence_tag_fwd.hpp>
- #include <boost/mpl/void.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/mpl/aux_/has_begin.hpp>
- #include <boost/mpl/aux_/na.hpp>
- #include <boost/mpl/aux_/traits_lambda_spec.hpp>
- #include <boost/mpl/aux_/config/eti.hpp>
- namespace boost { namespace mpl {
- namespace aux {
- template< typename Sequence >
- struct begin_type
- {
- typedef typename Sequence::begin type;
- };
- template< typename Sequence >
- struct end_type
- {
- typedef typename Sequence::end type;
- };
- }
- template< typename Tag >
- struct begin_impl
- {
- template< typename Sequence > struct apply
- {
- typedef typename eval_if<aux::has_begin<Sequence, true_>,
- aux::begin_type<Sequence>, void_>::type type;
- };
- };
- template< typename Tag >
- struct end_impl
- {
- template< typename Sequence > struct apply
- {
- typedef typename eval_if<aux::has_begin<Sequence, true_>,
- aux::end_type<Sequence>, void_>::type type;
- };
- };
- # define AUX778076_IMPL_SPEC(name, tag, result) \
- template<> \
- struct name##_impl<tag> \
- { \
- template< typename Sequence > struct apply \
- { \
- typedef result type; \
- }; \
- }; \
- AUX778076_IMPL_SPEC(begin, nested_begin_end_tag, typename Sequence::begin)
- AUX778076_IMPL_SPEC(end, nested_begin_end_tag, typename Sequence::end)
- AUX778076_IMPL_SPEC(begin, non_sequence_tag, void_)
- AUX778076_IMPL_SPEC(end, non_sequence_tag, void_)
- AUX778076_IMPL_SPEC(begin, na, void_)
- AUX778076_IMPL_SPEC(end, na, void_)
- # undef AUX778076_IMPL_SPEC
- BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,begin_impl)
- BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC_IMPL(1,end_impl)
- }}
- #endif
|