mattreecebentley / plf_list

A drop-in replacement for std::list with 293% faster insertion, 57% faster erasure, 17% faster iteration and 77% faster sorting on average. 20-24% speed increase in use-case testing.
https://plflib.org/list.htm
zlib License
151 stars 21 forks source link

ranges reverse_view and such no longer work and give compile error #25

Closed HSNB closed 1 year ago

HSNB commented 1 year ago

plf::list used to support for loop with reverse ranges, but now no longer compiles

plf::list<int> abc;
for (int x : std::ranges::reverse_view(abc)) {
}
for (int x : abc | std::views::reverse) {
}
for (int x : std::views::reverse(abc)) {
}

All of these give compile errors:

ranges(4854,36): error C2440: '': cannot convert from 'initializer list' to 'std::reverse_iterator<plf::list<int,std::allocator>::list_iterator>' message : No constructor could take the source type, or constructor overload resolution was ambiguous

On MSVC 2022

HSNB commented 1 year ago

Workaround:

plf::list<int> abc;
for (int x : std::ranges::reverse_view(std::ranges::take_view(abc, abc.size()))) {
}
mattreecebentley commented 1 year ago

Fixed as of last couple of updates - thanks

HSNB commented 1 year ago

it crashes now