Opened 3 years ago

Last modified 3 years ago

#10360 assigned Bugs

Since 1.56, any_range use static cast of reference instead of implicit conversion

Reported by: vdavid@… Owned by: neilgroves
Milestone: To Be Determined Component: range
Version: Boost 1.56.0 Severity: Regression
Keywords: Cc: p.omta@…


Since 1.56, when dereferencing, any_range tries to use static cast of reference instead of implicit conversion like in 1.55.

Here is an example that works with 1.55 but fails to compile with 1.56.

#include <boost/range/any_range.hpp>
#include <memory>
#include <vector>

struct A {};

int main() {
    std::vector<std::shared_ptr<A> > v;
    boost::any_range<std::shared_ptr<const A>,
                     std::shared_ptr<const A>,
                     std::ptrdiff_t> r(v);

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by anonymous

A work-around is to go through "boost::adaptors::transform" to do the conversion.

comment:2 Changed 3 years ago by neilgroves

  • Status changed from new to assigned

Drat, this is an unanticipated side-effect of a change to help other users with user-defined types.

I shall look at this during this week.

comment:3 Changed 3 years ago by Paul Omta <p.omta@…>

  • Cc p.omta@… added

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as assigned The owner will remain neilgroves.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.