]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/core/common.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / core / common.cpp
1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4
5 #include <boost/hana/core/common.hpp>
6
7 #include <type_traits>
8 namespace hana = boost::hana;
9
10
11 template <typename T>
12 struct ImplicitConvertibleTo {
13 constexpr operator T() const { return {}; }
14 };
15
16 struct T { };
17 struct invalid;
18
19 static_assert(std::is_same<hana::common_t<T, T>, T>{}, "");
20 static_assert(std::is_same<hana::common_t<invalid, invalid>, invalid>{}, "");
21 static_assert(std::is_same<hana::common_t<void, void>, void>{}, "");
22
23 static_assert(std::is_same<hana::common_t<ImplicitConvertibleTo<T>, T>, T>{}, "");
24 static_assert(std::is_same<hana::common_t<T, ImplicitConvertibleTo<T>>, T>{}, "");
25
26 static_assert(hana::has_common<T, T>{}, "");
27 static_assert(!hana::has_common<void, T>{}, "");
28 static_assert(!hana::has_common<T, void>{}, "");
29 static_assert(!hana::has_common<invalid, T>{}, "");
30 static_assert(!hana::has_common<T, invalid>{}, "");
31
32 int main() { }