Boost logo

Boost Users :

Subject: Re: [Boost-users] boost.test fails to zip custom datasets
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-12-08 00:11:11


AMDG

On 12/07/2017 03:47 PM, Georgios Sermaidis via Boost-users wrote:
> I am trying to understand how to use datasets with the boost.test library. I am following the documentation here <http://www.boost.org/doc/libs/1_65_1/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation/datasets.html> and have created my dataset as follows:
>
> namespace bdata = boost::unit_test::data;
>
> struct test_set {<snip>
> };
>
> namespace boost { namespace unit_test { namespace data { namespace monomorphic {
>
> template <>
> struct is_dataset<test_set> : std::true_type{};
> }}}}
> which is very simple and iterates numbers from 0 to 4.
>
> <snip>
> // error: invalid operands to binary expression ('typename data::result_of::make<test_set>::type' (aka 'test_set') and 'test_set') test_set() ^ test_set(),
> // ~~~~~~~~~~~^~~~~~~~~~~~~
> BOOST_DATA_TEST_CASE(
> example_test2,
> test_set() ^ test_set(),
> my_datum1, my_datum2) {
>
> std::cout << my_datum1 << " " << my_datum2 << std::endl;
> }
> Is what I am trying to do legal? If so, what is the correct way to achieve it? Thank you for your help!
>

The operator is not in scope and cannot be found by ADL. Try
  using bdata::monomorphic::operator^;

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net