Imported Upstream version 1.64.0
[platform/upstream/boost.git] / libs / hana / test / experimental / printable / set.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)
4
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/experimental/printable.hpp>
7 #include <boost/hana/integral_constant.hpp>
8 #include <boost/hana/set.hpp>
9 #include <boost/hana/string.hpp>
10
11 #include <sstream>
12 #include <string>
13 namespace hana = boost::hana;
14
15
16 int main() {
17     {
18         std::ostringstream ss;
19         ss << hana::experimental::print(
20             hana::make_set()
21         );
22         BOOST_HANA_RUNTIME_CHECK(ss.str() == "{}");
23     }
24
25     {
26         std::ostringstream ss;
27         ss << hana::experimental::print(
28             hana::make_set(hana::int_c<1>)
29         );
30         BOOST_HANA_RUNTIME_CHECK(ss.str() == "{1}");
31     }
32
33     {
34         std::ostringstream ss;
35         ss << hana::experimental::print(
36             hana::make_set(hana::int_c<1>, BOOST_HANA_STRING("3456"))
37         );
38         BOOST_HANA_RUNTIME_CHECK(ss.str() == "{1, \"3456\"}");
39     }
40
41     {
42         std::ostringstream ss;
43         ss << hana::experimental::print(
44             hana::make_set(hana::char_c<'x'>, BOOST_HANA_STRING("3456"))
45         );
46         BOOST_HANA_RUNTIME_CHECK(ss.str() == "{x, \"3456\"}");
47     }
48 }