]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/test/tools/detail/per_element_manip.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / test / tools / detail / per_element_manip.hpp
index 4a9aebbaaacbdc0a9b2d5eb1e0b149bbb1348c65..98b5703685279aad0b24a5a3c05d32f732d1dfc6 100644 (file)
 #include <boost/test/tools/detail/fwd.hpp>
 #include <boost/test/tools/detail/indirections.hpp>
 
+#include <boost/test/utils/lazy_ostream.hpp>
 #include <boost/test/tools/assertion.hpp>
 #include <boost/test/tools/collection_comparison_op.hpp>
 
+#include <ostream>
+
 #include <boost/test/detail/suppress_warnings.hpp>
 
 //____________________________________________________________________________//
@@ -31,12 +34,17 @@ namespace test_tools {
 // ************************************************************************** //
 
 //! Per element comparison manipulator, for containers
+//! This is a terminal that involves evaluation of the expression
 struct per_element {};
 
 //____________________________________________________________________________//
 
-inline int
-operator<<( unit_test::lazy_ostream const&, per_element )   { return 0; }
+inline unit_test::lazy_ostream&
+operator<<( unit_test::lazy_ostream &o, per_element )  { return o; }
+
+// needed for the lazy evaluation in lazy_ostream as per_element is a terminal
+inline std::ostream& 
+operator<<( std::ostream& o, per_element )             { return o; }
 
 //____________________________________________________________________________//
 
@@ -52,10 +60,10 @@ operator<<(assertion_evaluate_t<assertion::binary_expr<T1,T2,OP> > const& ae, pe
 
 //____________________________________________________________________________//
 
-inline check_type
+inline assertion_type
 operator<<( assertion_type const&, per_element )
 {
-    return CHECK_BUILT_ASSERTION;
+    return assertion_type(CHECK_BUILT_ASSERTION);
 }
 
 //____________________________________________________________________________//