]>
git.proxmox.com Git - ceph.git/blob - 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)
5 #include <boost/hana/core/common.hpp>
8 namespace hana
= boost::hana
;
12 struct ImplicitConvertibleTo
{
13 constexpr operator T() const { return {}; }
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>{}, "");
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
>{}, "");
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
>{}, "");