]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/optional/nested_type.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / optional / nested_type.cpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
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/optional.hpp>
6#include <boost/hana/type.hpp>
7
8#include <type_traits>
9namespace hana = boost::hana;
10
11
12// This test makes sure that an optional holding a hana::type has a
13// nested ::type alias.
14
15
16template <typename ...>
17using void_t = void;
18
19template <typename T, typename = void>
20struct has_type : std::false_type { };
21
22template <typename T>
23struct has_type<T, void_t<typename T::type>>
24 : std::true_type
25{ };
26
27
28struct T;
29
30static_assert(std::is_same<decltype(hana::just(hana::type_c<T>))::type, T>{}, "");
31static_assert(!has_type<decltype(hana::nothing)>{}, "");
32
33int main() { }