Functions | |
template<typename F > | |
impl::unique_adjacent_by< F > | rangeless::fn::unique_adjacent_by (F key_fn) |
Keep first element from every adjacently-equal run of elements. More... | |
impl::unique_adjacent_by< by::identity > | rangeless::fn::unique_adjacent () |
template<typename F > | |
impl::unique_all_by< F > | rangeless::fn::unique_all_by (F key_fn) |
Uniquefy elements globally, as-if unique_adjacent_by pre-sorted by same key. More... | |
impl::unique_all_by< by::identity > | rangeless::fn::unique_all () |
|
inline |
impl::unique_adjacent_by<F> rangeless::fn::unique_adjacent_by | ( | F | key_fn | ) |
|
inline |
impl::unique_all_by<F> rangeless::fn::unique_all_by | ( | F | key_fn | ) |
Uniquefy elements globally, as-if unique_adjacent_by
pre-sorted by same key.
If arg is a container, move contents to vector, and then sort-by and unique-adjacent-by.
If arg is a seq<In>
, compose seq<Out>
that will keep values of key_fn in a set, and skip already-seen elements.
NB: the lifetime of value returned by key_fn must be independent of arg.