View source code
							
							
						
								Display the source code in std/algorithm/iteration.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Function std.algorithm.iteration.uniq
Lazily iterates unique consecutive elements of the given range (functionality
akin to the uniq system
utility). Equivalence of elements is assessed by using the predicate
pred, by default "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). If the given range is
bidirectional, uniq also yields a
bidirectional range.
						
				auto auto uniq(alias pred, Range)
				(
				
				  Range r
				
				)
				
				if (isInputRange!Range && is(typeof(binaryFun!pred(r
				Parameters
| Name | Description | 
|---|---|
| pred | Predicate for determining equivalence between range elements. | 
| r | An input range of elements to filter. | 
Returns
An input range of
    consecutively unique elements in the original range. If r is also a
    forward range or bidirectional range, the returned range will be likewise.
Example
import stdAuthors
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.