Boost logo

Boost :

Subject: [boost] [range] concept checks break chained range adaptors
From: Jürgen Hunold (jhunold_at_[hidden])
Date: 2014-06-14 09:26:57


Hi Neil,

the fix for #9851 broke some of our code. We use chained range adaptors like

std::vector<std::string> separated
 std::set<Foo> foos;

boost::copy(separated |
                boost::adaptors::transformed(boost::bind(Foo::fromString, _1))
|
                boost::adaptors::filtered(boost::bind(&Foo::isValid, _1)),
                std::inserter(foos, foos.end()));

which fails with

 error: constructor for 'boost::transform_iterator<boost::_bi::bind_t<Foo, Foo
(*)(const std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > &), boost::_bi::list1<boost::arg<1> > >,
std::__1::__wrap_iter<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > *>,
boost::use_default, boost::use_default>' must explicitly initialize the member
'm_f' which does not have a default constructor
    transform_iterator() { }

Full testcase and error message attached.
This compiles and works with 1.55.0. git bisect shows that this fails to
compile from
5f2560f - Ticket 9851 - adaptors should perform concept check assertions.
for gcc and for clang starting with
e43796c - allow clang to use Range Concepts despite reporting GCC 4.2.
msvc-12.0 fails, too. gcc-4.8.2 and clang-3.5 (trunk) for the record.

Any chance to get this fixed for 1.56.0 ?

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold  ! 
* voice: ++49 4257 300       ! Fährstraße 1
* fax  : ++49 4257 300       ! 31609 Balge/Sebbenhausen
* jhunold_at_gmx.eu             ! Germany



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk