• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2001-2014 Joel de Guzman
3     Copyright (c) 2014 Agustin Berge
4 
5     Distributed under the Boost Software License, Version 1.0. (See accompanying
6     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_SPIRIT_X3_IS_PARSER_MAY_20_2013_0235PM)
9 #define BOOST_SPIRIT_X3_IS_PARSER_MAY_20_2013_0235PM
10 
11 #include <boost/mpl/bool.hpp>
12 #include <boost/spirit/home/x3/core/parser.hpp>
13 #include <boost/spirit/home/x3/support/utility/sfinae.hpp>
14 
15 namespace boost { namespace spirit { namespace x3 { namespace traits
16 {
17     ///////////////////////////////////////////////////////////////////////////
18     // is_parser<T>: metafunction that evaluates to mpl::true_ if a type T
19     // can be used as a parser, mpl::false_ otherwise
20     ///////////////////////////////////////////////////////////////////////////
21     template <typename T, typename Enable = void>
22     struct is_parser
23       : mpl::false_
24     {};
25 
26     template <typename T>
27     struct is_parser<T, typename disable_if_substitution_failure<
28         typename extension::as_parser<T>::type>::type>
29       : mpl::true_
30     {};
31 }}}}
32 
33 #endif
34