ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.05k stars 437 forks source link

views::concat doesn't work with std::vector #1791

Open vinesworth opened 11 months ago

vinesworth commented 11 months ago
#include <vector>
#include <range/v3/view/concat.hpp>

int main()
{
    std::vector<int> u, v;
    const auto w = u | ranges::views::concat(v);
}

MSVC:

(7): error C2678: binary '|': no operator found which takes a left-hand operand of type 'std::vector<int,std::allocator>' (or there is no acceptable conversion)

C:/data/msvc/14.36.32530-Pre/include\cstddef(43): note: could be 'std::byte std::operator |(const std::byte,const std::byte) noexcept' [found using argument-dependent lookup]

GCC reports something similar.

vinesworth commented 11 months ago

Might be related: https://stackoverflow.com/questions/69854503/why-do-i-need-to-evaluate-range-v3-views-to-be-able-to-use-them-with-concat