1// Copyright Louis Dionne 2013-2022
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/assert.hpp>
6#include <boost/hana/core/to.hpp>
7#include <boost/hana/equal.hpp>
8#include <boost/hana/integral_constant.hpp>
9#include <boost/hana/optional.hpp>
10#include <boost/hana/range.hpp>
11#include <boost/hana/tuple.hpp>
12namespace hana = boost::hana;
13
14
15int main() {
16 static_assert(hana::to<hana::tuple_tag>(hana::just(1)) == hana::make_tuple(1), "");
17 BOOST_HANA_CONSTANT_CHECK(hana::to<hana::tuple_tag>(hana::nothing) == hana::make_tuple());
18
19 BOOST_HANA_CONSTANT_CHECK(
20 hana::to<hana::tuple_tag>(hana::make_range(hana::int_c<3>, hana::int_c<6>))
21 ==
22 hana::tuple_c<int, 3, 4, 5>
23 );
24}
25

source code of boost/libs/hana/example/foldable/to.cpp