Tuple!(ElementType!R, uint),
representing each consecutively unique element and its respective number of occurrences in that run. This will be an input range if R is an input range, and a forward range in all other cases.
Groups consecutively equivalent elements into a single tuple of the element and the number of its repetitions.
Similarly to uniq, group produces a range that iterates over unique consecutive elements of the given range. Each element of this range is a tuple of the element and the number of times it is repeated in the original range. Equivalence of elements is assessed by using the predicate pred, which defaults to "a == b". The predicate is passed to binaryFun, and can either accept a string, or any callable that can be executed via pred(element, element).
pred | Binary predicate for determining equivalence of two elements. |
R | The range type |
r | The input range to iterate over. |
Tuple!(ElementType!R, uint),
representing each consecutively unique element and its respective number of occurrences in that run. This will be an input range if R is an input range, and a forward range in all other cases.
of equivalent adjacent elements.