• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef BOOST_METAPARSE_V1_IS_ERROR_HPP
2 #define BOOST_METAPARSE_V1_IS_ERROR_HPP
3 
4 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2011.
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/fail_tag.hpp>
10 
11 #include <boost/mpl/tag.hpp>
12 #include <boost/mpl/vector.hpp>
13 
14 #include <boost/type_traits/is_same.hpp>
15 
16 namespace boost
17 {
18   namespace metaparse
19   {
20     namespace v1
21     {
22       template <class T = boost::mpl::na>
23       struct is_error :
24         boost::is_same<
25           fail_tag,
26           typename boost::mpl::tag<typename T::type>::type
27         >
28       {};
29 
30       template <>
31       struct is_error<boost::mpl::na>
32       {
33         typedef is_error type;
34 
35         template <class T = boost::mpl::na>
36         struct apply : is_error<T> {};
37       };
38     }
39   }
40 }
41 
42 #endif
43 
44