[Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable
- Next message: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Previous message: Boost C++ Libraries: "[Boost-bugs] [Boost C++ Libraries] #11624: BOOST_TEST( 0.0 == 0.0 ) fails under C++11 (GCC and Clang)"
- Next in thread: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
#11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are
comparable
-------------------------------------+-------------------------------------
Reporter: Tony Lewis | Type: Bugs
<tonyelewis@â¦> | Milestone: To Be Determined
Status: new | Version: Boost 1.57.0
Component: None | Keywords:
Severity: Problem | BOOST_TEST,per_element,collections,comparable,element,range,equality
-------------------------------------+-------------------------------------
Thanks for the new BOOST_TEST() and per_element() tools, which look very
useful.
Unfortunately, I'm having trouble with comparing collections that aren't
themselves comparable but have comparable elements.
As I understand
[http://www.boost.org/libs/test/doc/html/boost_test/testing_tools/extended_comparison/collections.html#boost_test.testing_tools.extended_comparison.collections.requirements
the requirements documentation] for the BOOST_TEST / per_element() tools,
they should only require that the two collections' ''elements'' are
comparable, not necessarily the two collections themselves. I think this
approach makes a lot of sense.
However, when I try to compile the following under either `g++ -std=c++11`
or `clang -std=c++11 -stdlib=libc++`, the compilers complain that
collections aren't comparable :
{{{#!cpp
#define BOOST_TEST_MODULE comp_by_elem_mod
#include <boost/test/included/unit_test.hpp>
#include <iterator>
#include <vector>
struct my_class final {
std::vector<int> the_ints = { 1, 2, 3 };
using const_iterator = std::vector<int>::const_iterator;
const_iterator begin() const {
return std::begin( the_ints );
}
const_iterator end() const {
return std::end( the_ints );
}
};
BOOST_AUTO_TEST_CASE( comp_by_elem ) {
const my_class a{};
const std::vector<int> b = { 1, 2, 3 };
BOOST_TEST( a == b, ::boost::test_tools::per_element() );
}
}}}
I'll attach compiler errors.
Many thanks.
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11625>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
- Next message: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Previous message: Boost C++ Libraries: "[Boost-bugs] [Boost C++ Libraries] #11624: BOOST_TEST( 0.0 == 0.0 ) fails under C++11 (GCC and Clang)"
- Next in thread: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
- Reply: Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #11625: BOOST_TEST( ..., per_element() ) erroneously requires collections are comparable"
This archive was generated by hypermail 2.1.7
: 2017-02-16 18:50:19 UTC