Closed as not planned
Description
The following code in C++20:
#include <vector>
#include <ranges>
int main()
{
std::vector<int> i_vec({1, 2, 3});
auto rng = i_vec | std::ranges::views::take(2);
return 0;
}
Produces the following error in Clang 14.00:
<source>:8:19: error: invalid operands to binary expression ('std::vector<int>' and '_Partial<std::ranges::views::_Take, decay_t<int>>' (aka '_Partial<std::ranges::views::_Take, int>'))
auto rng = i_vec | std::ranges::views::take(2);
Godbolt: https://godbolt.org/z/c35r4Pa1h
The code as far as I can tell, is valid and works in GCC11 and MSVC 2022.
Unsure whether this is a libc++ or clang bug.
Metadata
Metadata
Assignees
Type
Projects
Status
Done