ericniebler / range-v3

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

Problem when sort a zip-view? #1727

Closed dangdkhanh closed 1 year ago

dangdkhanh commented 1 year ago

Hi, from this post I get an error when compiling as upload image (has it changed on newer version?)

image

Another issue is whether I can write predicate as a lambda? because I have some external parameters Something like this:

sort(zipped, [](auto &&a, auto &&b) {
//...
}

Unfortunately, this code also fails to compile. How do I fix them?

Thanks you.

brevzin commented 1 year ago

As with the last time, please provide a minimal and reproducible example in code, not as a screenshot.

My best guess as to what your code is compiles and runs fine.

dangdkhanh commented 1 year ago

Hi @brevzin , Sorry, I tried it and it actually works despite the red warning appearing. The error I got turned out to be from another location. This is exactly what I expected.

Thank you.