C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Floating an idea: unstable_remove_if and friends

From: Ted Lyngmo <ted_at_[hidden]>
Date: Thu, 30 Jan 2025 23:50:42 +0100
Jens Maurer via Std-Proposals:
>
> It was discussed in LEWG in Kona 2015.
>
> The poll said "nay", partly because the performance numbers in the paper
> were unconvincing. Maybe the testcase wasn't good, or the size of the
> array wasn't large enough or whatever.
>
> So, if you can demonstrate an actual (measurable) benefit compared to
> the alternatives, LEWG ought to get interested (again).
  Thanks! I'll try to put something together using
https://quick-bench.com/ during the weekend. It was a long ago I wrote
this and I didn't keep the measurements did back then.

> Sebastian Wittmeier via Std-Proposals:
>> You might like to compare/contrast your https://github.com/TedLyngmo/liblyncpp/blob/main/include/lyn/algorithm.hpp#L17-L35
>> with https://github.com/Quuxplusone/SG14/blob/master/include/sg14/algorithm_ext.h#L68-L130

I've now looked at it and I think the two implementations do exactly the
same operations to get it done, so, that's encouraging at least. :)

Note: After the comment about bidirectional iterators being required for
this to work, I opted to add a fallback to `std::remove_if` for
iterators that are not bidirectional. I'd be fine with asserting that
they are in fact bidirectional instead if that would be more in line
with what expectations a user might have.

Kind regards,
Ted Lyngmo

Received on 2025-01-30 22:50:48