// Copyright Louis Dionne 2013-2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include namespace hana = boost::hana; constexpr char const empty[] = ""; constexpr char const a[] = "a"; constexpr char const ab[] = "ab"; constexpr char const abc[] = "abc"; constexpr char const abcd[] = "abcd"; int main() { { auto string = hana::to(hana::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<>)); } { auto string = hana::to(hana::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<'a'>)); } { auto string = hana::to(hana::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<'a', 'b'>)); } { auto string = hana::to(hana::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<'a', 'b', 'c'>)); } { auto string = hana::to(hana::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<'a', 'b', 'c', 'd'>)); } // Make sure it also works with std::integral_constant, for example { auto string = hana::to(std::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<'a', 'b', 'c', 'd'>)); } // Make sure the `to_string` shortcut works { auto string = hana::to_string(hana::integral_constant{}); BOOST_HANA_CONSTANT_CHECK(hana::equal(string, hana::string_c<'a', 'b', 'c', 'd'>)); } }