]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/ext/boost/mpl/vector/to.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/ext/boost/mpl/vector.hpp>
7 #include <boost/hana/assert.hpp>
8 #include <boost/hana/core/to.hpp>
9 #include <boost/hana/equal.hpp>
10 #include <boost/hana/type.hpp>
12 #include <support/seq.hpp>
14 #include <boost/mpl/vector.hpp>
15 namespace hana
= boost::hana
;
16 namespace mpl
= boost::mpl
;
19 struct t1
; struct t2
; struct t3
; struct t4
;
22 // Conversion from any `Foldable` containing `type`s
23 auto foldable
= ::seq
;
24 auto to_vector
= hana::to
<hana::ext::boost::mpl::vector_tag
>;
25 BOOST_HANA_CONSTANT_CHECK(hana::equal(
26 to_vector(foldable()),
30 BOOST_HANA_CONSTANT_CHECK(hana::equal(
31 to_vector(foldable(hana::type_c
<t1
>)),
35 BOOST_HANA_CONSTANT_CHECK(hana::equal(
36 to_vector(foldable(hana::type_c
<t1
>, hana::type_c
<t2
>)),
40 BOOST_HANA_CONSTANT_CHECK(hana::equal(
41 to_vector(foldable(hana::type_c
<t1
>, hana::type_c
<t2
>, hana::type_c
<t3
>)),
42 mpl::vector
<t1
, t2
, t3
>{}
45 BOOST_HANA_CONSTANT_CHECK(hana::equal(
46 to_vector(foldable(hana::type_c
<t1
>, hana::type_c
<t2
>, hana::type_c
<t3
>, hana::type_c
<t4
>)),
47 mpl::vector
<t1
, t2
, t3
, t4
>{}