]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*////////////////////////////////////////////////////////////////////////////// |
2 | Copyright (c) 2014 Jamboree | |
3 | ||
4 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | //////////////////////////////////////////////////////////////////////////////*/ | |
7 | #ifndef BOOST_SPIRIT_X3_IS_CALLABLE_HPP_INCLUDED | |
8 | #define BOOST_SPIRIT_X3_IS_CALLABLE_HPP_INCLUDED | |
9 | ||
10 | #include <boost/mpl/bool.hpp> | |
11 | #include <boost/spirit/home/x3/support/utility/sfinae.hpp> | |
12 | ||
13 | namespace boost { namespace spirit { namespace x3 { namespace detail | |
14 | { | |
15 | template <typename Sig, typename Enable = void> | |
16 | struct is_callable_impl : mpl::false_ {}; | |
17 | ||
18 | template <typename F, typename... A> | |
19 | struct is_callable_impl<F(A...), typename disable_if_substitution_failure< | |
20 | decltype(std::declval<F>()(std::declval<A>()...))>::type> | |
21 | : mpl::true_ | |
22 | {}; | |
23 | }}}} | |
24 | ||
25 | namespace boost { namespace spirit { namespace x3 | |
26 | { | |
27 | template <typename Sig> | |
28 | struct is_callable; | |
29 | ||
30 | template <typename F, typename... A> | |
31 | struct is_callable<F(A...)> : detail::is_callable_impl<F(A...)> {}; | |
32 | }}} | |
33 | ||
34 | ||
35 | #endif |