1 #ifndef BOOST_METAPARSE_V1_IMPL_NTH_OF_C_IMPL_HPP
2 #define BOOST_METAPARSE_V1_IMPL_NTH_OF_C_IMPL_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
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/impl/skip_seq.hpp>
11 #include <boost/mpl/front.hpp>
12 #include <boost/mpl/pop_front.hpp>
13 #include <boost/mpl/fold.hpp>
23 template <int N, class Seq>
27 template <class NextResult>
28 struct apply_unchecked :
31 typename boost::mpl::pop_front<Seq>::type
33 typename get_remaining<NextResult>::type,
34 typename get_position<NextResult>::type
38 typedef nth_of_c_impl type;
40 template <class S, class Pos>
44 typename boost::mpl::front<Seq>::type::template apply<S, Pos>
46 typename boost::mpl::front<Seq>::type::template apply<S, Pos>,
48 typename boost::mpl::front<Seq>::type::template apply<S, Pos>
55 struct nth_of_c_impl<0, Seq>
57 typedef nth_of_c_impl type;
59 template <class S, class Pos>
62 typename boost::mpl::pop_front<Seq>::type,
63 typename boost::mpl::front<Seq>::type::template apply<