mirror of
https://github.com/dlang/phobos.git
synced 2025-05-08 20:19:43 +03:00
Add REF-erences to the text in std.algorithm.iteration.cache
This commit is contained in:
parent
4e00114390
commit
be7dd97d2f
1 changed files with 6 additions and 6 deletions
|
@ -119,16 +119,16 @@ if (fun.length >= 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/++
|
/++
|
||||||
`cache` eagerly evaluates `front` of `range`
|
`cache` eagerly evaluates $(REF_ALTTEXT front, front, std,_range,primitives) of `range`
|
||||||
on each construction or call to `popFront`,
|
on each construction or call to $(REF_ALTTEXT popFront, popFront, std,_range,primitives),
|
||||||
to store the result in a _cache.
|
to store the result in a _cache.
|
||||||
The result is then directly returned when `front` is called,
|
The result is then directly returned when $(REF_ALTTEXT front, front, std,_range,primitives) is called,
|
||||||
rather than re-evaluated.
|
rather than re-evaluated.
|
||||||
|
|
||||||
This can be a useful function to place in a chain, after functions
|
This can be a useful function to place in a chain, after functions
|
||||||
that have expensive evaluation, as a lazy alternative to $(REF array, std,array).
|
that have expensive evaluation, as a lazy alternative to $(REF array, std,array).
|
||||||
In particular, it can be placed after a call to `map`, or before a call
|
In particular, it can be placed after a call to $(LREF map), or before a call
|
||||||
to `filter` or `tee`.
|
$(REF filter, std,_range) or $(REF tee, std,_range)
|
||||||
|
|
||||||
`cache` may provide
|
`cache` may provide
|
||||||
$(REF_ALTTEXT bidirectional _range, isBidirectionalRange, std,_range,primitives)
|
$(REF_ALTTEXT bidirectional _range, isBidirectionalRange, std,_range,primitives)
|
||||||
|
@ -148,7 +148,7 @@ Params:
|
||||||
range = an $(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
|
range = an $(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
an input _range with the cached values of _range
|
An $(REF_ALTTEXT input _range, isInputRange, std,_range,primitives) with the cached values of _range
|
||||||
+/
|
+/
|
||||||
auto cache(Range)(Range range)
|
auto cache(Range)(Range range)
|
||||||
if (isInputRange!Range)
|
if (isInputRange!Range)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue