]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/experimental/printable/metafunction.cpp
1 // Copyright Jason Rice 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/experimental/printable.hpp>
7 #include <boost/hana/integral_constant.hpp>
8 #include <boost/hana/type.hpp>
12 namespace hana
= boost::hana
;
15 template <typename T
> struct my_template
{ };
16 template <typename
...> struct my_mf
{ struct type
; };
17 struct my_mf_class
{ template <typename
...> struct apply
{ struct type
; }; };
22 std::ostringstream ss
;
23 ss
<< hana::experimental::print(
24 hana::template_
<foo::my_template
>
26 BOOST_HANA_RUNTIME_CHECK(std::regex_match(ss
.str(),
27 std::regex("template<(?:struct )?foo::my_template>")));
30 std::ostringstream ss
;
31 ss
<< hana::experimental::print(
32 hana::metafunction
<foo::my_mf
>
34 BOOST_HANA_RUNTIME_CHECK(std::regex_match(ss
.str(),
35 std::regex("metafunction<(?:struct )?foo::my_mf>")));
38 std::ostringstream ss
;
39 ss
<< hana::experimental::print(
40 hana::metafunction_class
<foo::my_mf_class
>
42 BOOST_HANA_RUNTIME_CHECK(std::regex_match(ss
.str(),
43 std::regex("metafunction_class<(?:struct )?foo::my_mf_class>")));