1 | /* |
2 | Copyright 2020 Glen Joseph Fernandes |
3 | (glenjofe@gmail.com) |
4 | |
5 | Distributed under the Boost Software License, |
6 | Version 1.0. (See accompanying file LICENSE_1_0.txt |
7 | or copy at http://www.boost.org/LICENSE_1_0.txt) |
8 | */ |
9 | |
10 | #ifndef BOOST_TT_DISJUNCTION_HPP_INCLUDED |
11 | #define BOOST_TT_DISJUNCTION_HPP_INCLUDED |
12 | |
13 | #include <boost/type_traits/conditional.hpp> |
14 | #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) |
15 | #include <boost/type_traits/integral_constant.hpp> |
16 | #endif |
17 | |
18 | namespace boost { |
19 | |
20 | #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) |
21 | template<class...> |
22 | struct disjunction |
23 | : false_type { }; |
24 | |
25 | template<class T> |
26 | struct disjunction<T> |
27 | : T { }; |
28 | |
29 | template<class T, class... U> |
30 | struct disjunction<T, U...> |
31 | : conditional<bool(T::value), T, disjunction<U...> >::type { }; |
32 | #else |
33 | template<class T, class U> |
34 | struct disjunction |
35 | : conditional<bool(T::value), T, U>::type { }; |
36 | #endif |
37 | |
38 | } /* boost */ |
39 | |
40 | #endif |
41 | |