diff --git a/doc/closing_chapters/change_log.qbk b/doc/closing_chapters/change_log.qbk index 90c4fc4d30..64eeb2c0de 100644 --- a/doc/closing_chapters/change_log.qbk +++ b/doc/closing_chapters/change_log.qbk @@ -43,6 +43,7 @@ Boost.Test releases: # [pull_request 275] Replace anonymous `enum` arity with `static constexpr` # [pull_request 278] Use `boost_test_print_type` customization point in `lazy_ostream` # [pull_request 281] Export `execution_aborted` exception to allow catching it from outside the DLL +# [pull_request 323] Check that `lazy_ostream` argument is printable [#ref_CHANGE_LOG_3_14][h4 Boost.Test v3.14 / boost 1.74] diff --git a/include/boost/test/utils/lazy_ostream.hpp b/include/boost/test/utils/lazy_ostream.hpp index 2d1edbed8e..7d62fd46b1 100644 --- a/include/boost/test/utils/lazy_ostream.hpp +++ b/include/boost/test/utils/lazy_ostream.hpp @@ -15,6 +15,10 @@ #include #include +// Boost +#include +#include + // STL #include @@ -75,6 +79,8 @@ class lazy_ostream_impl : public lazy_ostream { , m_prev( prev ) , m_value( value ) { + BOOST_STATIC_ASSERT_MSG( (boost::has_left_shift::value), + "Type has to implement operator<< to be printable"); } std::ostream& operator()( std::ostream& ostr ) const BOOST_OVERRIDE