2 Copyright Barrett Adair 2015-2017
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
10 #define BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
12 #undef BOOST_CLBL_TRTS_DISJUNCTION
13 #define BOOST_CLBL_TRTS_DISJUNCTION(...) \
14 ::boost::callable_traits::detail::disjunction<__VA_ARGS__>
16 namespace boost { namespace callable_traits { namespace detail {
18 //polyfill for C++17 std::disjunction
20 struct disjunction : std::false_type {};
23 struct disjunction<T> : T {};
25 template<typename T, typename... Ts>
26 struct disjunction<T, Ts...>
27 : std::conditional<T::value != false, T, disjunction<Ts...>>::type {};
29 }}} // namespace boost::callable_traits::detail
31 #endif // #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP