summaryrefslogtreecommitdiff
path: root/boost/test/tools/detail/print_helper.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/test/tools/detail/print_helper.hpp')
-rw-r--r--boost/test/tools/detail/print_helper.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/boost/test/tools/detail/print_helper.hpp b/boost/test/tools/detail/print_helper.hpp
index 77b936c44b..39ab707f36 100644
--- a/boost/test/tools/detail/print_helper.hpp
+++ b/boost/test/tools/detail/print_helper.hpp
@@ -22,9 +22,12 @@
// Boost
#include <boost/mpl/or.hpp>
+#include <boost/static_assert.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/is_abstract.hpp>
+#include <boost/type_traits/has_left_shift.hpp>
+
#include <limits>
#include <boost/test/detail/suppress_warnings.hpp>
@@ -41,6 +44,9 @@ namespace tt_detail {
template<typename T>
struct print_log_value {
+ BOOST_STATIC_ASSERT_MSG( (boost::has_left_shift<std::ostream,T>::value),
+ "Type has to implement operator<< to be printable");
+
void operator()( std::ostream& ostr, T const& t )
{
typedef typename mpl::or_<is_array<T>,is_function<T>,is_abstract<T> >::type cant_use_nl;