You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encontered an issue when trying to compile a simple use case with gcc 8.2. I have the following code:
std::vector<int> buff(12, -1);
::ranges::span<int> sp(buff.data(), 12);
auto x = ::ranges::view::transform(sp, [](int a) { return a > 3 ? a : 42; });
auto y = ::ranges::view::transform(x, sp, [](int a, int b) { return a + b; });
auto rng = ::ranges::view::transform(y, [](int a) { return a + 1; });
The last line fails to compile with gcc 8.2 and issue the following error:
/.../.conan/data/range-v3/0.4.0/ericniebler/stable/package/e52aec0ecc24318bcb1daf3dc03e2f3e38ea6e23/include/range/v3/view/transform.hpp:278:53:
error: conversion from
‘basic_iterator<adaptor_cursor<[...],adaptor<true>>>’
to non-scalar type
‘basic_iterator<adaptor_cursor<[...],adaptor<false>>>’ requested
iterator_t<Rng1> it1 = ranges::begin(rng1_);
~~~~~~~~~~~~~^~~~~~~
After investigating the conversion constructors, it seems that basic_iterator explicitly have one, adaptor too, but I didn't see one for adaptor_cursor (except for a using base_t::base_t, but maybe it is not even needed for adaptor_cursor since there are no members). As for why the "const" boolean is true in one case and false in the other, I don't know (bad deduction/overload somewhere ?)
Clang7 seems to compile it so I don't know if it is a compiler bug or a library bug.
Hello,
I've encontered an issue when trying to compile a simple use case with gcc 8.2. I have the following code:
The last line fails to compile with gcc 8.2 and issue the following error:
(full stack in attachment)
error_full.txt
When I've investigated a little bit further, I tried to change the code of view::transform:
by:
Now I get this error:
(full stack in attachment)
error_full2.txt
After investigating the conversion constructors, it seems that
basic_iterator
explicitly have one, adaptor too, but I didn't see one foradaptor_cursor
(except for ausing base_t::base_t
, but maybe it is not even needed foradaptor_cursor
since there are no members). As for why the "const" boolean is true in one case and false in the other, I don't know (bad deduction/overload somewhere ?)Clang7 seems to compile it so I don't know if it is a compiler bug or a library bug.
You can find a live repro on godbolt.
The text was updated successfully, but these errors were encountered: