1 #ifndef BOOST_METAPARSE_V1_CPP11_NTH_OF_C_HPP
2 #define BOOST_METAPARSE_V1_CPP11_NTH_OF_C_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/cpp11/impl/nth_of_c.hpp>
11 #include <boost/metaparse/v1/fail.hpp>
12 #include <boost/metaparse/v1/error/index_out_of_range.hpp>
14 #include <type_traits>
22 template <int N, class... Ps>
25 typedef nth_of_c type;
27 template <class S, class Pos>
30 (0 <= N && N < sizeof...(Ps)),
31 impl::nth_of_c<N, S, Pos, Ps...>,
32 typename fail<error::index_out_of_range<0, sizeof...(Ps) - 1, N>>
33 ::template apply<S, Pos>
39 struct nth_of_c<N> : fail<error::index_out_of_range<0, -1, N>> {};