TartanLlama/ranges

Compatibility issue between std::views::iota and tl::views::enumerate

Closed this issue · 1 comments

In the unit test below, a compilation error occurs.

TEST_CASE("std::ranges::iota_view") {
    for (auto&& [i, j] : (std::views::iota(0) | tl::views::enumerate | std::views::take(10))) {
        REQUIRE(i == j);
    }
}

Error message:

error C2678: binary '|': no operator found which takes a left-hand operand of type 'tl::enumerate_view<std::ranges::iota_view<_Ty,std::unreachable_sentinel_t>>' (or there is no acceptable conversion)
with
[
_Ty=int
]

Fixed in c68f937