|
inline |
|
inline |
impl::group_adjacent_by<F> rangeless::fn::group_adjacent_by | ( | F | key_fn | ) |
Group adjacent elements.
If arg is a container, works similar to group_all_by
, except returns a std::vector<Cont>
where each container contains adjacently-equal elements having same value of key.
If arg is a seq<...>
, composes a seq<...>
that shall yield vector<value_type>
s having same value of key. (NB: if the value_type is a char, the group-type is std::string).
Buffering space requirements for seq
: O(max-groupsize)
.
impl::group_adjacent_as_subseqs_by<F> rangeless::fn::group_adjacent_by | ( | F | key_fn, |
impl::to_seq | |||
) |
Group adjacent elements.
This is similar to regular group_adjacent_by
, except the result type is a seq yielding subseqs of equivalent elements, rather than vectors.
This is useful for cases where a subseq can be arbitrarily large, and you want to process grouped elements on-the-fly without accumulating them in a vector.
This comes at the cost of more constrained functionality, since all groups and all elements in each group can only be accessed once and in order.
impl::group_adjacent_by<fn::by::identity, BinaryPred> rangeless::fn::group_adjacent_if | ( | BinaryPred | pred2 | ) |
impl::group_adjacent_as_subseqs_by<fn::by::identity, BinaryPred> rangeless::fn::group_adjacent_if | ( | BinaryPred | pred2, |
impl::to_seq | |||
) |
|
inline |
impl::group_all_by<F> rangeless::fn::group_all_by | ( | F | key_fn | ) |
Similar to group_adjacent_by
, but presorts the elements.
Buffering space requirements for seq
: O(N)
.
|
inline |
Group adjacent elements into chunks of specified size.
Buffering space requirements for seq
: O(n)
.