Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
0002 #define BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
0003 
0004 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2017.
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/is_error.hpp>
0010 #include <boost/metaparse/v1/get_remaining.hpp>
0011 #include <boost/metaparse/v1/get_position.hpp>
0012 #include <boost/metaparse/v1/return_.hpp>
0013 
0014 #include <type_traits>
0015 
0016 namespace boost
0017 {
0018   namespace metaparse
0019   {
0020     namespace v1
0021     {
0022       namespace impl
0023       {
0024         template <class FinalResult, class S, class Pos, class... Ps>
0025         struct nth_of_c_skip_remaining;
0026 
0027         template <class FinalResult, class S, class Pos>
0028         struct nth_of_c_skip_remaining<FinalResult, S, Pos> :
0029           return_<FinalResult>::template apply<S, Pos>
0030         {};
0031 
0032         template <class FinalResult, class S, class Pos, class P, class... Ps>
0033         struct nth_of_c_skip_remaining<FinalResult, S, Pos, P, Ps...>
0034         {
0035         private:
0036           template <class NextResult>
0037           struct apply_unchecked :
0038             nth_of_c_skip_remaining<
0039               FinalResult,
0040               typename get_remaining<NextResult>::type,
0041               typename get_position<NextResult>::type,
0042               Ps...
0043             >
0044           {};
0045         public:
0046           typedef
0047             typename std::conditional<
0048               is_error<typename P::template apply<S, Pos>>::type::value,
0049               typename P::template apply<S, Pos>,
0050               apply_unchecked<typename P::template apply<S, Pos>>
0051             >::type::type
0052             type;
0053         };
0054       }
0055     }
0056   }
0057 }
0058 
0059 #endif
0060