]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/example/tuple/interop.cpp
4be8adf58648bc5bfde587a97eed883c23766cf1
1 // Copyright Louis Dionne 2013-2016
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/assert.hpp>
6 #include <boost/hana/core/to.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/ext/std/array.hpp>
9 #include <boost/hana/ext/std/tuple.hpp>
10 #include <boost/hana/integral_constant.hpp>
11 #include <boost/hana/range.hpp>
12 #include <boost/hana/tuple.hpp>
16 namespace hana
= boost::hana
;
21 hana::to_tuple(std::make_tuple(1, '2', 3.3)) == hana::make_tuple(1, '2', 3.3)
24 BOOST_HANA_CONSTANT_CHECK(
25 hana::to_tuple(hana::make_range(hana::int_c
<1>, hana::int_c
<4>))
27 hana::make_tuple(hana::int_c
<1>, hana::int_c
<2>, hana::int_c
<3>)
30 // std::array's operator[] is not constexpr, so we can't use static_assert
31 BOOST_HANA_CONSTEXPR_CHECK(
32 hana::to_tuple(std::array
<int, 3>{{1, 2, 3}}) == hana::make_tuple(1, 2, 3)