]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/include/boost/metaparse/v1/impl/iterate_impl.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / metaparse / include / boost / metaparse / v1 / impl / iterate_impl.hpp
1 #ifndef BOOST_METAPARSE_V1_IMPL_ITERATE_IMPL_HPP
2 #define BOOST_METAPARSE_V1_IMPL_ITERATE_IMPL_HPP
3
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)
8
9 #include <boost/metaparse/v1/impl/iterate_impl_unchecked.hpp>
10 #include <boost/metaparse/v1/return_.hpp>
11 #include <boost/metaparse/v1/is_error.hpp>
12
13 #include <boost/mpl/eval_if.hpp>
14
15 namespace boost
16 {
17 namespace metaparse
18 {
19 namespace v1
20 {
21 namespace impl
22 {
23 template <int N, class P, class Accum>
24 struct iterate_impl
25 {
26 typedef iterate_impl type;
27
28 template <class S, class Pos>
29 struct apply :
30 boost::mpl::eval_if<
31 typename is_error<typename P::template apply<S, Pos> >::type,
32 typename P::template apply<S, Pos>,
33 iterate_impl_unchecked<N, P, Accum, S, Pos>
34 >
35 {};
36 };
37
38 template <class P, class Accum>
39 struct iterate_impl<0, P, Accum> : return_<Accum> {};
40 }
41 }
42 }
43 }
44
45 #endif
46