1 #ifndef BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
2 #define BOOST_METAPARSE_V1_CPP11_IMPL_NTH_OF_C_SKIP_REMANING_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/metaparse/v1/is_error.hpp>
10 #include <boost/metaparse/v1/get_remaining.hpp>
11 #include <boost/metaparse/v1/get_position.hpp>
12 #include <boost/metaparse/v1/return_.hpp>
14 #include <type_traits>
24 template <class FinalResult, class S, class Pos, class... Ps>
25 struct nth_of_c_skip_remaining;
27 template <class FinalResult, class S, class Pos>
28 struct nth_of_c_skip_remaining<FinalResult, S, Pos> :
29 return_<FinalResult>::template apply<S, Pos>
32 template <class FinalResult, class S, class Pos, class P, class... Ps>
33 struct nth_of_c_skip_remaining<FinalResult, S, Pos, P, Ps...>
36 template <class NextResult>
37 struct apply_unchecked :
38 nth_of_c_skip_remaining<
40 typename get_remaining<NextResult>::type,
41 typename get_position<NextResult>::type,
47 typename std::conditional<
48 is_error<typename P::template apply<S, Pos>>::type::value,
49 typename P::template apply<S, Pos>,
50 apply_unchecked<typename P::template apply<S, Pos>>