]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/optional/nested_type.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/optional.hpp>
6 #include <boost/hana/type.hpp>
9 namespace hana
= boost::hana
;
12 // This test makes sure that an optional holding a hana::type has a
13 // nested ::type alias.
16 template <typename
...>
19 template <typename T
, typename
= void>
20 struct has_type
: std::false_type
{ };
23 struct has_type
<T
, void_t
<typename
T::type
>>
30 static_assert(std::is_same
<decltype(hana::just(hana::type_c
<T
>))::type
, T
>{}, "");
31 static_assert(!has_type
<decltype(hana::nothing
)>{}, "");