C++ Logo

std-discussion

Advanced search

Re: Adding a new modification of algorithm std::unique

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Fri, 12 Jan 2024 19:21:24 +0100
On 12/01/2024 19:03, Vladimir Grigoriev wrote:
> I am sure that it is a drawback of the library of
> the standard algorithms. What alternative can you suggest?

I wouldn't call it a "drawback"; it's a *design* of the std::unique
algorithm. You're proposing a variation of it that doesn't eliminate the
equivalent elements in each run, it just moves them. That's completely
fine to propose if you have a use case for it! Just find a good name for
this variation (which is really the only thing I've been questioning),
properly define the semantics of what happens with the elements after
the first of each run, and create a suitable proposal.

My 2 c,
-- 
Giuseppe D'Angelo

Received on 2024-01-12 18:21:28