Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:48

0001 #ifndef BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP
0002 #define BOOST_METAPARSE_V1_CPP11_SEQUENCE_HPP
0003 
0004 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2018.
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/metaparse/v1/cpp11/impl/push_front_result.hpp>
0010 
0011 #include <boost/metaparse/v1/get_remaining.hpp>
0012 #include <boost/metaparse/v1/get_position.hpp>
0013 #include <boost/metaparse/v1/is_error.hpp>
0014 #include <boost/metaparse/v1/return_.hpp>
0015 #include <boost/metaparse/v1/transform.hpp>
0016 
0017 #include <boost/mpl/eval_if.hpp>
0018 #include <boost/mpl/vector.hpp>
0019 
0020 namespace boost
0021 {
0022   namespace metaparse
0023   {
0024     namespace v1
0025     {
0026       template <class... Ps>
0027       struct sequence;
0028 
0029       template <>
0030       struct sequence<> : return_<boost::mpl::vector<>> {};
0031 
0032       template <class P, class... Ps>
0033       struct sequence<P, Ps...>
0034       {
0035       private:
0036         template <class Res>
0037         struct apply_unchecked :
0038           transform<
0039             sequence<Ps...>,
0040             impl::push_front_result<Res>
0041           >::template apply<
0042             typename get_remaining<Res>::type,
0043             typename get_position<Res>::type
0044           >
0045         {};
0046       public:
0047         typedef sequence type;
0048 
0049         template <class S, class Pos>
0050         struct apply :
0051           boost::mpl::eval_if<
0052             typename is_error<typename P::template apply<S, Pos>>::type,
0053             typename P::template apply<S, Pos>,
0054             apply_unchecked<typename P::template apply<S, Pos>>
0055           >
0056         {};
0057       };
0058     }
0059   }
0060 }
0061 
0062 #endif