]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/detail/create.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/config.hpp>
6 #include <boost/hana/detail/create.hpp>
10 namespace hana
= boost::hana
;
13 constexpr hana::detail::create
<std::tuple
> make_tuple
{};
14 constexpr hana::detail::create
<std::pair
> make_pair
{};
16 template <typename
...>
20 struct single_holder
{ T x
; };
23 struct identity
{ using type
= T
; };
25 template <typename
...T
>
26 using identity_t
= typename identity
<T
...>::type
;
29 static_assert(make_tuple(1, '2', 3.3) == std::make_tuple(1, '2', 3.3), "");
30 static_assert(make_pair(1, '2') == std::make_pair(1, '2'), "");
33 hana::detail::create
<empty
>{}();
34 hana::detail::create
<single_holder
>{}(1);
35 hana::detail::create
<single_holder
>{}([]{});
36 hana::detail::create
<identity_t
>{}(1);
38 // Clang < 3.7.0 fails this test
39 #if !defined(BOOST_HANA_CONFIG_CLANG) || \
40 BOOST_HANA_CONFIG_CLANG >= BOOST_HANA_CONFIG_VERSION(3, 7, 0)
41 hana::detail::create
<identity_t
>{}([]{});