range-v3
range-v3 copied to clipboard
ranges::view::all & concepts viewable_range are different with std::ranges
Hello , today I found that ranges::view::all cannot accept a prvalue range.
For example , R = std::vector<int>
is not a ranges::viewable_range.
But the same usage with std::ranges is ok , which shows difference with range-v3 .
According to range.all , all(std::vector<int>())
should be correct ( it is an owning_view in std::ranges ) .
It is actually "viewable" .
#include <range/v3/view.hpp>
#include <ranges>
#include <vector>
void foo(){
auto v1 = ranges::view::all(std::vector<int>()); // error
auto v2 = std::ranges::views::all(std::vector<int>()); // std is ok , which gets an owning_view
static_assert(std::ranges::viewable_range<std::vector<int>>); // true
static_assert(ranges::viewable_range<std::vector<int>>); // false
}
Does we need to ensure any consistency between range-v3 & std::ranges ?
Yeah, range-v3 doesn't implement P2415 yet.
Thanks for reply ! Is there any plan to implement P2415 in future versions ?
Yeah, range-v3 doesn't implement P2415 yet.
consistency with C++20 would be nice and owning_view would be a nice addition