1 #ifndef BOOST_METAPARSE_V1_IF__HPP
2 #define BOOST_METAPARSE_V1_IF__HPP
3 
4 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2009 - 2010.
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/accept.hpp>
10 #include <boost/metaparse/v1/is_error.hpp>
11 
12 #include <boost/mpl/if.hpp>
13 
14 namespace boost
15 {
16   namespace metaparse
17   {
18     namespace v1
19     {
20       template <class P, class T, class F>
21       struct if_
22       {
23         typedef if_ type;
24 
25         template <class S, class Pos>
26         struct apply :
27           accept<
28             typename boost::mpl::if_<
29               is_error<typename P::template apply<S, Pos> >,
30               F,
31               T
32             >::type,
33             S,
34             Pos
35           >
36         {};
37       };
38     }
39   }
40 }
41 
42 #endif
43 
44