File indexing completed on 2025-01-18 09:40:48
0001 #ifndef BOOST_METAPARSE_V1_CPP11_LAST_OF_HPP
0002 #define BOOST_METAPARSE_V1_CPP11_LAST_OF_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/metaparse/v1/cpp11/impl/nth_of_c.hpp>
0010
0011 #include <boost/metaparse/v1/fail.hpp>
0012 #include <boost/metaparse/v1/error/index_out_of_range.hpp>
0013
0014 namespace boost
0015 {
0016 namespace metaparse
0017 {
0018 namespace v1
0019 {
0020 template <class... Ps>
0021 struct last_of
0022 {
0023 typedef last_of type;
0024
0025 template <class S, class Pos>
0026 struct apply : impl::nth_of_c<sizeof...(Ps) - 1, S, Pos, Ps...> {};
0027 };
0028
0029 template <>
0030 struct last_of<> : fail<error::index_out_of_range<0, -1, 0>> {};
0031 }
0032 }
0033 }
0034
0035 #endif
0036