#ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED #define BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED // // Copyright 2015 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // #include #include namespace boost { namespace type_traits_detail { // mp_valid // implementation by Bruno Dutra (by the name is_evaluable) template class F, class... T> struct mp_valid_impl { template class G, class = G> static boost::true_type check_s(int); template class> static boost::false_type check_s(...); using type = decltype(check_s(0)); }; template class F, class... T> using mp_valid = typename mp_valid_impl::type; // mp_defer struct mp_empty { }; template class F, class... T> struct mp_defer_impl { using type = F; }; template class F, class... T> using mp_defer = typename boost::conditional::value, mp_defer_impl, mp_empty>::type; } // namespace type_traits_detail } // namespace boost #endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED