C++ Logo


Advanced search

Re: [std-proposals] Introduction of std::is_uniqued()

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 14 Apr 2023 12:00:43 -0400
On Fri, Apr 14, 2023 at 11:02 AM LoS via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> As suggested in a reply to my previous proposal, I drafted a proposal to introduce the std::is_uniqued() function.
> Since it was developed from Arthur's idea, I would be very happy if you took part in the proposal.
> I. Motivation
> The std::is_uniqued() function can be used to check if a range of elements has no consecutive equal elements.
> Even if there is already the std::adjacent_find() function, that can be used to get the same effect, the introduction of the function std::is_uniqued makes the check clearer, like std::contains() and std::is_sorted() do.

Is this a thing people want to do? `std::contains` is a thing that
people sometimes need to do as a distinct action from `std::find`.
What code needs to detect if a range has "consecutive equal elements"
*without* also wanting to know where that element is?

Received on 2023-04-14 16:00:56