diff options
Diffstat (limited to 'src/boost/libs/hana/test/experimental/printable/optional.cpp')
-rw-r--r-- | src/boost/libs/hana/test/experimental/printable/optional.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/boost/libs/hana/test/experimental/printable/optional.cpp b/src/boost/libs/hana/test/experimental/printable/optional.cpp new file mode 100644 index 00000000..c963204c --- /dev/null +++ b/src/boost/libs/hana/test/experimental/printable/optional.cpp @@ -0,0 +1,29 @@ +// Copyright Jason Rice 2015 +// 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 <boost/hana/assert.hpp> +#include <boost/hana/experimental/printable.hpp> +#include <boost/hana/integral_constant.hpp> +#include <boost/hana/optional.hpp> + +#include <sstream> +namespace hana = boost::hana; + + +int main() { + { + std::ostringstream ss; + ss << hana::experimental::print( + hana::just(hana::int_c<5>) + ); + BOOST_HANA_RUNTIME_CHECK(ss.str() == "just(5)"); + } + { + std::ostringstream ss; + ss << hana::experimental::print( + hana::nothing + ); + BOOST_HANA_RUNTIME_CHECK(ss.str() == "nothing"); + } +} |