Closed rolesen closed 4 years ago
I might add that it is also an issue when compiling with MSVC.
This issue was already posted 5 years ago in the Boost issue tracker: https://svn.boost.org/trac10/ticket/10493
I would also like to see this fixed.
Edit: The bug was probably introduced in: 79d2a66831af16f29befaa4d32461928b9431a15
IMHO the fix didn't fully solve the issue. At least, the code provided by rolesen still doesn't compile (even with gcc 11 and boost 1.76, which as far as I can see, contains the PR) - and same with Msvc 2019 (16.9.4)
When a range is transformed into a new type and then "type erased" it gives an invalid range in optimized code only. See provided examples.
Using either the implicit conversion to any_range or the type erasure adaptor doesn't seem to make a difference.
Permalink to wandbox:
https://wandbox.org/permlink/CG2FhOBnO9gesp5w