It would be handy to have some range adaptors that are missing in std::ranges in here as well. Please add more as you like:
all_of, none_of, any_of that accept the range to be piped in
remove_element that accepts one argument and removes equality matches. Optionally with an additional binary predicate that is used instead of equality
all_equal Again, optionally with binary predicate
iota but with the interface of range() in python, e.g.:
range<size_t>(5): 0...4
range<size_t>(1,5): 1...4
range<size_t>(5,1): empty
range<size_t>(5,1,-1): 4...1
empty (and non_empty) that falls back to std::ranges::begin(range) == std::ranges::end(range) if std::ranges::empty is not supported
unique deduplicates elements.
This has probably some assumptions like elements being copyable without side effects.
having an equality operator
having a hash or being orderable
optionally, equality, less and hash function could be provided
all_distinct checks if all elements are distinct, again optional binary predicate to replace equality operator
join for std::format as provided in https://fmt.dev/latest/api/#range-and-tuple-formatting
It would be handy to have some range adaptors that are missing in
std::rangesin here as well. Please add more as you like:all_of,none_of,any_ofthat accept the range to be piped inremove_elementthat accepts one argument and removes equality matches. Optionally with an additional binary predicate that is used instead of equalityall_equalAgain, optionally with binary predicateiotabut with the interface ofrange()in python, e.g.:range<size_t>(5): 0...4range<size_t>(1,5): 1...4range<size_t>(5,1): emptyrange<size_t>(5,1,-1): 4...1empty(and non_empty) that falls back tostd::ranges::begin(range) == std::ranges::end(range)ifstd::ranges::emptyis not supporteduniquededuplicates elements.all_distinctchecks if all elements are distinct, again optional binary predicate to replace equality operatorjoinforstd::formatas provided in https://fmt.dev/latest/api/#range-and-tuple-formatting