1 #ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED
2 #define BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED
5 // Copyright 2015 Peter Dimov
7 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
12 #include <boost/type_traits/integral_constant.hpp>
13 #include <boost/type_traits/conditional.hpp>
18 namespace type_traits_detail
22 // implementation by Bruno Dutra (by the name is_evaluable)
24 template<template<class...> class F, class... T>
27 template<template<class...> class G, class = G<T...>>
28 static boost::true_type check_s(int);
30 template<template<class...> class>
31 static boost::false_type check_s(...);
33 using type = decltype(check_s<F>(0));
36 template<template<class...> class F, class... T>
37 using mp_valid = typename mp_valid_impl<F, T...>::type;
45 template<template<class...> class F, class... T> struct mp_defer_impl
50 template<template<class...> class F, class... T> using mp_defer = typename boost::conditional<mp_valid<F, T...>::value, mp_defer_impl<F, T...>, mp_empty>::type;
52 } // namespace type_traits_detail
56 #endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED