#ifndef BOOST_METAPARSE_V1_CPP98_IMPL_NTH_OF_C_IMPL_HPP #define BOOST_METAPARSE_V1_CPP98_IMPL_NTH_OF_C_IMPL_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include namespace boost { namespace metaparse { namespace v1 { namespace impl { template struct nth_of_c_impl { private: template struct apply_unchecked : nth_of_c_impl< N - 1, typename boost::mpl::pop_front::type >::template apply< typename get_remaining::type, typename get_position::type > {}; public: typedef nth_of_c_impl type; template struct apply : boost::mpl::eval_if< typename is_error< typename boost::mpl::front::type::template apply >::type, typename boost::mpl::front::type::template apply, apply_unchecked< typename boost::mpl::front::type::template apply > > {}; }; template struct nth_of_c_impl<0, Seq> { typedef nth_of_c_impl type; template struct apply : boost::mpl::fold< typename boost::mpl::pop_front::type, typename boost::mpl::front::type::template apply< S, Pos >::type, skip_seq > {}; }; } } } } #endif