As suggested in a reply to my previous proposal, I drafted a proposal to introduce the std::is_uniqued() function.
I feel somebody should point out that uniqued is not a word.
On Sat, Apr 15, 2023 at 6:32 AM LoS wrote:
@Jonathan, probably you are right.
That's useful prior art for the verb (besides the prior art in C++ and Unix
). Do note that Swift's notion of "uniqued" is "contains no
duplicates," whereas C++'s and Unix's is "contains no adjacent
duplicates." This could be confusing; but I think the existence of the `std::unique` algorithm in C++ makes it pretty easy to remember (and teach) what `is_uniqued` means.
- `std::sort` sorts an array and makes it sorted, such that it `is_sorted`.
- `std::unique` uniques an array and makes it uniqued, such that it `is_uniqued`.
The odd one out is `std::make_heap` (`make_unique` was taken ;)) and `is_heap` — that pair of algorithms could better have been named `heapify` and `is_heapified`.
I've put up a draft revision of D2848R0 "std::is_uniqued" here
. Comments welcome. (Also pull requests
, if anyone wants to beat me to a libc++ implementation. I don't plan to work on that for the next 12 hours at least.)