Opened 8 years ago
Last modified 8 years ago
#10360 assigned Bugs
Since 1.56, any_range use static cast of reference instead of implicit conversion
| Reported by: | Owned by: | Neil Groves | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | range |
| Version: | Boost 1.56.0 | Severity: | Regression |
| Keywords: | Cc: | p.omta@… |
Description
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>,
boost::forward_traversal_tag,
std::shared_ptr<const A>,
std::ptrdiff_t> r(v);
}
Change History (3)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
| Status: | new → 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 by , 8 years ago
| Cc: | added |
|---|
Note:
See TracTickets
for help on using tickets.

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