[Boost-bugs] [Boost C++ Libraries] #11571: Can't compile BOOST_TEST( ..., per_element() ) comparison of vector<string>

Subject: [Boost-bugs] [Boost C++ Libraries] #11571: Can't compile BOOST_TEST( ..., per_element() ) comparison of vector<string>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-08-23 16:11:55


#11571: Can't compile BOOST_TEST( ..., per_element() ) comparison of vector<string>
-------------------------------------------------+-------------------------
 Reporter: Tony Lewis <tonyelewis@…> | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.59.0 | Severity: Problem
 Keywords: |
  test,BOOST_TEST,per_element,collections,string,vector|
-------------------------------------------------+-------------------------
 Thanks for the new BOOST_TEST() and per_element() tools, which look very
 useful.

 Unfortunately, the following simple vector<string> example fails to
 compile under both `g++ -std=c++11` and `clang++ -std=c++11
 -stdlib=libc++`.

 {{{
 #!cpp
 #define BOOST_TEST_MODULE comp_str_mod

 #include <boost/test/included/unit_test.hpp>

 #include <string>
 #include <vector>

 BOOST_AUTO_TEST_CASE( comp_strs ) {
         std::vector<std::string> a{ "ann" };
         std::vector<std::string> b{ "bry" };

         BOOST_TEST( a == b, boost::test_tools::per_element() );
 }
 }}}

 The core part of GCC's error message is:

 {{{
 error: ‘revert’ is not a member of
 â€˜boost::test_tools::assertion::op::EQ<std::basic_string<char>,
 std::basic_string<char>, void>’
 }}}

 If I'm doing it wrong, is there any way we can make the compile errors
 and/or documentation clearer about avoiding this? Thanks.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11571>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC