rangeless::fn
Uniquefying

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::identityrangeless::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::identityrangeless::fn::unique_all ()
 

Detailed Description

Function Documentation

◆ unique_adjacent()

impl::unique_adjacent_by<by::identity> rangeless::fn::unique_adjacent ( )
inline

Definition at line 4256 of file fn.hpp.

◆ unique_adjacent_by()

template<typename F >
impl::unique_adjacent_by<F> rangeless::fn::unique_adjacent_by ( key_fn)

Keep first element from every adjacently-equal run of elements.

If arg is a container, apply erase-unique idiom and return the container.

If arg is a seq<In>, compose seq<Out> that will yield first element from every adjacently-equal run of elements.

Definition at line 4251 of file fn.hpp.

◆ unique_all()

impl::unique_all_by<by::identity> rangeless::fn::unique_all ( )
inline

Definition at line 4275 of file fn.hpp.

◆ unique_all_by()

template<typename F >
impl::unique_all_by<F> rangeless::fn::unique_all_by ( 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.

Definition at line 4270 of file fn.hpp.