/* @copyright Louis Dionne 2014 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 #include #include using namespace boost::hana; int main() { //! [to_string] auto to_string = [](auto x) { return (std::ostringstream{} << x).str(); }; assert( fmap(to_string, list(1, '2', "345", std::string{"67"})) == list("1", "2", "345", "67") ); BOOST_HANA_STATIC_ASSERT(fmap(to_string, nothing) == nothing); assert(fmap(to_string, just(123)) == just("123")); //! [to_string] //! [add_pointer] BOOST_HANA_STATIC_ASSERT( fmap(template_, type_list) == type_list ); //! [add_pointer] }