mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
fix package XREFs
Also add escaping underscores in some places, and rewrap to 80 columns where touching anyway.
This commit is contained in:
parent
559038b363
commit
b28962635f
19 changed files with 255 additions and 189 deletions
|
@ -129,7 +129,7 @@ $(D cache) does not provide random access primitives,
|
||||||
as $(D cache) would be unable to cache the random accesses.
|
as $(D cache) would be unable to cache the random accesses.
|
||||||
If $(D Range) provides slicing primitives,
|
If $(D Range) provides slicing primitives,
|
||||||
then $(D cache) will provide the same slicing primitives,
|
then $(D cache) will provide the same slicing primitives,
|
||||||
but $(D hasSlicing!Cache) will not yield true (as the $(XREF range,hasSlicing)
|
but $(D hasSlicing!Cache) will not yield true (as the $(XREF_PACK _range,primitives,hasSlicing)
|
||||||
trait also checks for random access).
|
trait also checks for random access).
|
||||||
+/
|
+/
|
||||||
auto cache(Range)(Range range)
|
auto cache(Range)(Range range)
|
||||||
|
@ -1295,7 +1295,8 @@ defaults to $(D "a == b").
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = Binary predicate for determining equivalence of two elements.
|
pred = Binary predicate for determining equivalence of two elements.
|
||||||
r = The $(XREF2 range, isInputRange, input range) to iterate over.
|
r = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to
|
||||||
|
iterate over.
|
||||||
|
|
||||||
Returns: A range of elements of type $(D Tuple!(ElementType!R, uint)),
|
Returns: A range of elements of type $(D Tuple!(ElementType!R, uint)),
|
||||||
representing each consecutively unique element and its respective number of
|
representing each consecutively unique element and its respective number of
|
||||||
|
@ -1680,8 +1681,8 @@ unittest
|
||||||
* they appear in the original range.
|
* they appear in the original range.
|
||||||
*
|
*
|
||||||
* See_also:
|
* See_also:
|
||||||
* $(XREF algorithm,group), which collapses adjacent equivalent elements into a
|
* $(LREF group), which collapses adjacent equivalent elements into a single
|
||||||
* single element.
|
* element.
|
||||||
*/
|
*/
|
||||||
auto chunkBy(alias pred, Range)(Range r)
|
auto chunkBy(alias pred, Range)(Range r)
|
||||||
if (isInputRange!Range)
|
if (isInputRange!Range)
|
||||||
|
@ -1891,10 +1892,10 @@ is a range. If you do not provide a separator, then the ranges are
|
||||||
joined directly without anything in between them.
|
joined directly without anything in between them.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
r = An $(XREF2 range, isInputRange, input range) of input ranges to be
|
r = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of input
|
||||||
joined.
|
ranges to be joined.
|
||||||
sep = A $(XREF2 range, isForwardRange, forward range) of element(s) to
|
sep = A $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) of
|
||||||
serve as separators in the joined range.
|
element(s) to serve as separators in the joined range.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
An input range of elements in the joined range. This will be a forward range if
|
An input range of elements in the joined range. This will be a forward range if
|
||||||
|
@ -2853,8 +2854,8 @@ below).
|
||||||
Params:
|
Params:
|
||||||
pred = The predicate for comparing each element with the separator,
|
pred = The predicate for comparing each element with the separator,
|
||||||
defaulting to $(D "a == b").
|
defaulting to $(D "a == b").
|
||||||
r = The $(XREF2 range, isInputRange, input range) to be split. Must support
|
r = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to be
|
||||||
slicing and $(D .length).
|
split. Must support slicing and $(D .length).
|
||||||
s = The element to be treated as the separator between range segments to be
|
s = The element to be treated as the separator between range segments to be
|
||||||
split.
|
split.
|
||||||
|
|
||||||
|
@ -3134,9 +3135,10 @@ empty elements.
|
||||||
Params:
|
Params:
|
||||||
pred = The predicate for comparing each element with the separator,
|
pred = The predicate for comparing each element with the separator,
|
||||||
defaulting to $(D "a == b").
|
defaulting to $(D "a == b").
|
||||||
r = The $(XREF2 range, isInputRange, input range) to be split.
|
r = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to be
|
||||||
s = The $(XREF2 range, isForwardRange, forward range) to be treated as the
|
split.
|
||||||
separator between segments of $(D r) to be split.
|
s = The $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) to
|
||||||
|
be treated as the separator between segments of $(D r) to be split.
|
||||||
|
|
||||||
Constraints:
|
Constraints:
|
||||||
The predicate $(D pred) needs to accept an element of $(D r) and an
|
The predicate $(D pred) needs to accept an element of $(D r) and an
|
||||||
|
@ -3442,7 +3444,8 @@ empty elements.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
isTerminator = The predicate for deciding where to split the range.
|
isTerminator = The predicate for deciding where to split the range.
|
||||||
input = The $(XREF2 range, isInputRange, input range) to be split.
|
input = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to
|
||||||
|
be split.
|
||||||
|
|
||||||
Constraints:
|
Constraints:
|
||||||
The predicate $(D isTerminator) needs to accept an element of $(D input).
|
The predicate $(D isTerminator) needs to accept an element of $(D input).
|
||||||
|
@ -3688,8 +3691,8 @@ Params:
|
||||||
s = The string to be split.
|
s = The string to be split.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
An $(XREF2 range, isInputRange, input range) of slices of the original
|
An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of slices of
|
||||||
string split by whitespace.
|
the original string split by whitespace.
|
||||||
+/
|
+/
|
||||||
auto splitter(C)(C[] s)
|
auto splitter(C)(C[] s)
|
||||||
if (isSomeChar!C)
|
if (isSomeChar!C)
|
||||||
|
@ -3870,14 +3873,17 @@ if (isSomeChar!C)
|
||||||
|
|
||||||
// sum
|
// sum
|
||||||
/**
|
/**
|
||||||
Sums elements of $(D r), which must be a finite $(XREF2 range, isInputRange, input range). Although
|
Sums elements of $(D r), which must be a finite
|
||||||
|
$(XREF_PACK_NAMED range,primitives,isInputRange,input range). Although
|
||||||
conceptually $(D sum(r)) is equivalent to $(LREF reduce)!((a, b) => a +
|
conceptually $(D sum(r)) is equivalent to $(LREF reduce)!((a, b) => a +
|
||||||
b)(0, r), $(D sum) uses specialized algorithms to maximize accuracy,
|
b)(0, r), $(D sum) uses specialized algorithms to maximize accuracy,
|
||||||
as follows.
|
as follows.
|
||||||
|
|
||||||
$(UL
|
$(UL
|
||||||
$(LI If $(D $(XREF range, ElementType)!R) is a floating-point type and $(D R) is a
|
$(LI If $(D $(XREF_PACK range,primitives,ElementType)!R) is a floating-point
|
||||||
$(XREF2 range, isRandomAccessRange, random-access range) with length and slicing, then $(D sum) uses the
|
type and $(D R) is a
|
||||||
|
$(XREF_PACK_NAMED range,primitives,isRandomAccessRange,random-access range) with
|
||||||
|
length and slicing, then $(D sum) uses the
|
||||||
$(WEB en.wikipedia.org/wiki/Pairwise_summation, pairwise summation)
|
$(WEB en.wikipedia.org/wiki/Pairwise_summation, pairwise summation)
|
||||||
algorithm.)
|
algorithm.)
|
||||||
$(LI If $(D ElementType!R) is a floating-point type and $(D R) is a
|
$(LI If $(D ElementType!R) is a floating-point type and $(D R) is a
|
||||||
|
@ -4070,12 +4076,13 @@ bidirectional, $(D uniq) also yields a bidirectional range.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = Predicate for determining equivalence between range elements.
|
pred = Predicate for determining equivalence between range elements.
|
||||||
r = An $(XREF2 range, isInputRange, input range) of elements to filter.
|
r = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of
|
||||||
|
elements to filter.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
An $(XREF2 range, isInputRange, input range) of consecutively unique
|
An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of
|
||||||
elements in the original range. If $(D r) is also a forward range or
|
consecutively unique elements in the original range. If $(D r) is also a
|
||||||
bidirectional range, the returned range will be likewise.
|
forward range or bidirectional range, the returned range will be likewise.
|
||||||
*/
|
*/
|
||||||
auto uniq(alias pred = "a == b", Range)(Range r)
|
auto uniq(alias pred = "a == b", Range)(Range r)
|
||||||
if (isInputRange!Range && is(typeof(binaryFun!pred(r.front, r.front)) == bool))
|
if (isInputRange!Range && is(typeof(binaryFun!pred(r.front, r.front)) == bool))
|
||||||
|
|
|
@ -446,11 +446,13 @@ $(WEB sgi.com/tech/stl/copy_backward.html, STL's copy_backward'):
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assigns $(D value) to each element of input range $(D range).
|
Assigns $(D value) to each element of input _range $(D range).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
range = An $(XREF2 range, isInputRange, input range) that exposes references to its elements
|
range = An
|
||||||
and has assignable elements
|
$(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
|
||||||
|
that exposes references to its elements and has assignable
|
||||||
|
elements
|
||||||
value = Assigned to each element of range
|
value = Assigned to each element of range
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
|
@ -560,10 +562,11 @@ $(D range) does not have to be a multiple of the length of $(D
|
||||||
filler). If $(D filler) is empty, an exception is thrown.
|
filler). If $(D filler) is empty, an exception is thrown.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
range = An $(XREF2 range, isInputRange, input range) that exposes
|
range = An $(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
|
||||||
references to its elements and has assignable elements.
|
that exposes references to its elements and has assignable elements.
|
||||||
filler = The $(XREF2 range, isForwardRange, forward range) representing the
|
filler = The
|
||||||
_fill pattern.
|
$(XREF_PACK_NAMED _range,primitives,isForwardRange,forward _range)
|
||||||
|
representing the _fill pattern.
|
||||||
*/
|
*/
|
||||||
void fill(Range1, Range2)(Range1 range, Range2 filler)
|
void fill(Range1, Range2)(Range1 range, Range2 filler)
|
||||||
if (isInputRange!Range1
|
if (isInputRange!Range1
|
||||||
|
@ -680,8 +683,10 @@ Initializes all elements of $(D range) with their $(D .init) value.
|
||||||
Assumes that the elements of the range are uninitialized.
|
Assumes that the elements of the range are uninitialized.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
range = An $(XREF2 range, isInputRange, input range) that exposes references to its elements
|
range = An
|
||||||
and has assignable elements
|
$(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
|
||||||
|
that exposes references to its elements and has assignable
|
||||||
|
elements
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
$(LREF fill)
|
$(LREF fill)
|
||||||
|
@ -1168,9 +1173,10 @@ An exception will be thrown if this condition does not hold, i.e., there is not
|
||||||
enough room in $(D tgt) to accommodate all of $(D src).
|
enough room in $(D tgt) to accommodate all of $(D src).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
src = An $(XREF2 range, isInputRange, input range) with movable elements.
|
src = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) with
|
||||||
tgt = An $(XREF2 range, isInputRange, input range) with elements that
|
movable elements.
|
||||||
elements from $(D src) can be moved into.
|
tgt = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) with
|
||||||
|
elements that elements from $(D src) can be moved into.
|
||||||
|
|
||||||
Returns: The leftover portion of $(D tgt) after all elements from $(D src) have
|
Returns: The leftover portion of $(D tgt) after all elements from $(D src) have
|
||||||
been moved.
|
been moved.
|
||||||
|
@ -1218,9 +1224,10 @@ tgt) in lockstep in increasing order, calls $(D move(a, b)). Stops
|
||||||
when either $(D src) or $(D tgt) have been exhausted.
|
when either $(D src) or $(D tgt) have been exhausted.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
src = An $(XREF2 range, isInputRange, input range) with movable elements.
|
src = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) with
|
||||||
tgt = An $(XREF2 range, isInputRange, input range) with elements that
|
movable elements.
|
||||||
elements from $(D src) can be moved into.
|
tgt = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) with
|
||||||
|
elements that elements from $(D src) can be moved into.
|
||||||
|
|
||||||
Returns: The leftover portions of the two ranges after one or the other of the
|
Returns: The leftover portions of the two ranges after one or the other of the
|
||||||
ranges have been exhausted.
|
ranges have been exhausted.
|
||||||
|
@ -1314,8 +1321,8 @@ In the case above the element at offset $(D 1) is removed and $(D
|
||||||
remove) returns the range smaller by one element. The original array
|
remove) returns the range smaller by one element. The original array
|
||||||
has remained of the same length because all functions in $(D
|
has remained of the same length because all functions in $(D
|
||||||
std.algorithm) only change $(I content), not $(I topology). The value
|
std.algorithm) only change $(I content), not $(I topology). The value
|
||||||
$(D 8) is repeated because $(XREF algorithm, move) was invoked to move
|
$(D 8) is repeated because $(LREF move) was invoked to
|
||||||
elements around and on integers $(D move) simply copies the source to
|
move elements around and on integers $(D move) simply copies the source to
|
||||||
the destination. To replace $(D a) with the effect of the removal,
|
the destination. To replace $(D a) with the effect of the removal,
|
||||||
simply assign $(D a = remove(a, 1)). The slice will be rebound to the
|
simply assign $(D a = remove(a, 1)). The slice will be rebound to the
|
||||||
shorter array and the operation completes with maximal efficiency.
|
shorter array and the operation completes with maximal efficiency.
|
||||||
|
@ -2217,8 +2224,10 @@ define copy constructors (for all other types, $(LREF fill) and
|
||||||
uninitializedFill are equivalent).
|
uninitializedFill are equivalent).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
range = An $(XREF2 range, isInputRange, input range) that exposes references to its elements
|
range = An
|
||||||
and has assignable elements
|
$(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
|
||||||
|
that exposes references to its elements and has assignable
|
||||||
|
elements
|
||||||
value = Assigned to each element of range
|
value = Assigned to each element of range
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
|
|
|
@ -101,7 +101,7 @@ template all(alias pred = "a")
|
||||||
{
|
{
|
||||||
/++
|
/++
|
||||||
Returns $(D true) if and only if $(I _all) values $(D v) found in the
|
Returns $(D true) if and only if $(I _all) values $(D v) found in the
|
||||||
input range $(D range) satisfy the predicate $(D pred).
|
input _range $(D range) satisfy the predicate $(D pred).
|
||||||
Performs (at most) $(BIGOH range.length) evaluations of $(D pred).
|
Performs (at most) $(BIGOH range.length) evaluations of $(D pred).
|
||||||
+/
|
+/
|
||||||
bool all(Range)(Range range)
|
bool all(Range)(Range range)
|
||||||
|
@ -147,7 +147,7 @@ template any(alias pred = "a")
|
||||||
{
|
{
|
||||||
/++
|
/++
|
||||||
Returns $(D true) if and only if $(I _any) value $(D v) found in the
|
Returns $(D true) if and only if $(I _any) value $(D v) found in the
|
||||||
input range $(D range) satisfies the predicate $(D pred).
|
input _range $(D range) satisfies the predicate $(D pred).
|
||||||
Performs (at most) $(BIGOH range.length) evaluations of $(D pred).
|
Performs (at most) $(BIGOH range.length) evaluations of $(D pred).
|
||||||
+/
|
+/
|
||||||
bool any(Range)(Range range)
|
bool any(Range)(Range range)
|
||||||
|
@ -361,9 +361,11 @@ Params:
|
||||||
pred = The predicate to use in comparing elements for commonality. Defaults
|
pred = The predicate to use in comparing elements for commonality. Defaults
|
||||||
to equality $(D "a == b").
|
to equality $(D "a == b").
|
||||||
|
|
||||||
r1 = A $(XREF2 range, isForwardRange, forward range) of elements.
|
r1 = A $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) of
|
||||||
|
elements.
|
||||||
|
|
||||||
r2 = An $(XREF2 range, isInputRange, input range) of elements.
|
r2 = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of
|
||||||
|
elements.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A slice of $(D r1) which contains the characters that both ranges start with,
|
A slice of $(D r1) which contains the characters that both ranges start with,
|
||||||
|
@ -665,14 +667,18 @@ size_t count(alias pred = "true", R)(R haystack)
|
||||||
}
|
}
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Counts elements in the given $(XREF2 range, isForwardRange, forward range)
|
Counts elements in the given
|
||||||
|
$(XREF_PACK_NAMED range,primitives,isForwardRange,forward range)
|
||||||
until the given predicate is true for one of the given $(D needles).
|
until the given predicate is true for one of the given $(D needles).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = The predicate for determining when to stop counting.
|
pred = The predicate for determining when to stop counting.
|
||||||
haystack = The $(XREF2 range, isInputRange, input range) to be counted.
|
haystack = The
|
||||||
needles = Either a single element, or a $(XREF2 range, isForwardRange,
|
$(XREF_PACK_NAMED range,primitives,isInputRange,input range) to be
|
||||||
forward range) of elements, to be evaluated in turn against each
|
counted.
|
||||||
|
needles = Either a single element, or a
|
||||||
|
$(XREF_PACK_NAMED range,primitives,isForwardRange,forward range)
|
||||||
|
of elements, to be evaluated in turn against each
|
||||||
element in $(D haystack) under the given predicate.
|
element in $(D haystack) under the given predicate.
|
||||||
|
|
||||||
Returns: The number of elements which must be popped from the front of
|
Returns: The number of elements which must be popped from the front of
|
||||||
|
@ -833,8 +839,9 @@ ptrdiff_t countUntil(alias pred = "a == b", R, N)(R haystack, N needle)
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = Predicate to when to stop counting.
|
pred = Predicate to when to stop counting.
|
||||||
haystack = An $(XREF2 range, isInputRange, input range) of elements
|
haystack = An
|
||||||
to be counted.
|
$(XREF_PACK_NAMED range,primitives,isInputRange,input range) of
|
||||||
|
elements to be counted.
|
||||||
Returns: The number of elements which must be popped from $(D haystack)
|
Returns: The number of elements which must be popped from $(D haystack)
|
||||||
before $(D pred(haystack.front)) is $(D true).
|
before $(D pred(haystack.front)) is $(D true).
|
||||||
+/
|
+/
|
||||||
|
@ -929,7 +936,8 @@ Params:
|
||||||
pred = The predicate to use for comparing elements between the range and
|
pred = The predicate to use for comparing elements between the range and
|
||||||
the needle(s).
|
the needle(s).
|
||||||
|
|
||||||
doesThisEnd = The $(XREF2 range, isBidirectionalRange, bidirectional range)
|
doesThisEnd = The
|
||||||
|
$(XREF_PACK_NAMED range,primitives,isBidirectionalRange,bidirectional range)
|
||||||
to check.
|
to check.
|
||||||
|
|
||||||
withOneOfThese = The needles to check against, which may be single
|
withOneOfThese = The needles to check against, which may be single
|
||||||
|
@ -1165,7 +1173,8 @@ $(D "a == b").
|
||||||
The negated predicate $(D "a != b") can be used to search instead for the first
|
The negated predicate $(D "a != b") can be used to search instead for the first
|
||||||
element $(I not) matching the needle.
|
element $(I not) matching the needle.
|
||||||
|
|
||||||
haystack = The $(XREF2 range, isInputRange, input range) searched in.
|
haystack = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range)
|
||||||
|
searched in.
|
||||||
|
|
||||||
needle = The element searched for.
|
needle = The element searched for.
|
||||||
|
|
||||||
|
@ -1456,7 +1465,8 @@ Params:
|
||||||
pred = The predicate for determining if a given element is the one being
|
pred = The predicate for determining if a given element is the one being
|
||||||
searched for.
|
searched for.
|
||||||
|
|
||||||
haystack = The $(XREF2 range, isInputRange, input range) to search in.
|
haystack = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to
|
||||||
|
search in.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
|
@ -1545,9 +1555,11 @@ Params:
|
||||||
pred = The predicate to use for comparing respective elements from the haystack
|
pred = The predicate to use for comparing respective elements from the haystack
|
||||||
and the needle. Defaults to simple equality $(D "a == b").
|
and the needle. Defaults to simple equality $(D "a == b").
|
||||||
|
|
||||||
haystack = The $(XREF2 range, isForwardRange, forward range) searched in.
|
haystack = The $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range)
|
||||||
|
searched in.
|
||||||
|
|
||||||
needle = The $(XREF2 range, isForwardRange, forward range) searched for.
|
needle = The $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range)
|
||||||
|
searched for.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
|
@ -2174,7 +2186,8 @@ evaluations of $(D pred).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = The predicate to satisfy.
|
pred = The predicate to satisfy.
|
||||||
r = A $(XREF2 range, isForwardRange, forward range) to search in.
|
r = A $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) to
|
||||||
|
search in.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
$(D r) advanced to the first occurrence of two adjacent elements that satisfy
|
$(D r) advanced to the first occurrence of two adjacent elements that satisfy
|
||||||
|
@ -2249,9 +2262,10 @@ Performs $(BIGOH seq.length * choices.length) evaluations of $(D pred).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = The predicate to use for determining a match.
|
pred = The predicate to use for determining a match.
|
||||||
seq = The $(XREF2 range, isInputRange, input range) to search.
|
seq = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to
|
||||||
choices = A $(XREF2 range, isForwardRange, forward range) of possible
|
search.
|
||||||
choices.
|
choices = A $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range)
|
||||||
|
of possible choices.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
$(D seq) advanced to the first matching element, or until empty if there are no
|
$(D seq) advanced to the first matching element, or until empty if there are no
|
||||||
|
@ -2295,8 +2309,12 @@ Range1 findAmong(alias pred = "a == b", Range1, Range2)(
|
||||||
* right after the first occurrence of $(D needle).
|
* right after the first occurrence of $(D needle).
|
||||||
*
|
*
|
||||||
* Params:
|
* Params:
|
||||||
* haystack = The $(XREF2 range, isForwardRange, forward range) to search in.
|
* haystack = The
|
||||||
* needle = The $(XREF2 range, isForwardRange, forward range) to search for.
|
* $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) to search
|
||||||
|
* in.
|
||||||
|
* needle = The
|
||||||
|
* $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) to search
|
||||||
|
* for.
|
||||||
*
|
*
|
||||||
* Returns: $(D true) if the needle was found, in which case $(D haystack) is
|
* Returns: $(D true) if the needle was found, in which case $(D haystack) is
|
||||||
* positioned after the end of the first occurrence of $(D needle); otherwise
|
* positioned after the end of the first occurrence of $(D needle); otherwise
|
||||||
|
@ -2841,9 +2859,10 @@ range, or do nothing if there is no match.
|
||||||
Params:
|
Params:
|
||||||
pred = The predicate that determines whether elements from each respective
|
pred = The predicate that determines whether elements from each respective
|
||||||
range match. Defaults to equality $(D "a == b").
|
range match. Defaults to equality $(D "a == b").
|
||||||
r1 = The $(XREF2 range, isForwardRange, forward range) to move forward.
|
r1 = The $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) to
|
||||||
r2 = The $(XREF2 range, isInputRange, input range) representing the initial
|
move forward.
|
||||||
segment of $(D r1) to skip over.
|
r2 = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range)
|
||||||
|
representing the initial segment of $(D r1) to skip over.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
true if the initial segment of $(D r1) matches $(D r2), and $(D r1) has been
|
true if the initial segment of $(D r1) matches $(D r2), and $(D r1) has been
|
||||||
|
@ -2920,7 +2939,8 @@ Params:
|
||||||
pred = The predicate that determines whether an element from the range
|
pred = The predicate that determines whether an element from the range
|
||||||
matches the given element.
|
matches the given element.
|
||||||
|
|
||||||
r = The $(XREF range, isInputRange, input range) to skip over.
|
r = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to skip
|
||||||
|
over.
|
||||||
|
|
||||||
e = The element to match.
|
e = The element to match.
|
||||||
|
|
||||||
|
@ -2967,8 +2987,9 @@ bool skipOver(alias pred, R, E)(ref R r, E e)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Checks whether the given $(XREF2 range, isInputRange, input range) starts with
|
Checks whether the given
|
||||||
(one of) the given needle(s).
|
$(XREF_PACK_NAMED range,primitives,isInputRange,input range) starts with (one
|
||||||
|
of) the given needle(s).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
|
|
||||||
|
@ -3395,17 +3416,19 @@ $(D pred(e, sentinel)) is true.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pred = Predicate to determine when to stop.
|
pred = Predicate to determine when to stop.
|
||||||
range = The $(XREF2 range, isInputRange, input range) to iterate over.
|
range = The $(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
|
||||||
|
to iterate over.
|
||||||
sentinel = The element to stop at.
|
sentinel = The element to stop at.
|
||||||
openRight = Determines whether the element for which the given predicate is
|
openRight = Determines whether the element for which the given predicate is
|
||||||
true should be included in the resulting range ($(D OpenRight.no)), or
|
true should be included in the resulting range ($(D OpenRight.no)), or
|
||||||
not ($(D OpenRight.yes)).
|
not ($(D OpenRight.yes)).
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
An $(XREF2 range, isInputRange, input range) that iterates over the
|
An $(XREF_PACK_NAMED _range,primitives,isInputRange,input _range) that
|
||||||
original range's elements, but ends when the specified predicate becomes
|
iterates over the original range's elements, but ends when the specified
|
||||||
true. If the original range is a $(XREF2 range, isForwardRange, forward
|
predicate becomes true. If the original range is a
|
||||||
range) or higher, this range will be a forward range.
|
$(XREF_PACK_NAMED _range,primitives,isForwardRange,forward _range) or
|
||||||
|
higher, this range will be a forward range.
|
||||||
*/
|
*/
|
||||||
Until!(pred, Range, Sentinel)
|
Until!(pred, Range, Sentinel)
|
||||||
until(alias pred = "a == b", Range, Sentinel)
|
until(alias pred = "a == b", Range, Sentinel)
|
||||||
|
|
|
@ -944,7 +944,7 @@ time complexity.
|
||||||
See_Also:
|
See_Also:
|
||||||
$(XREF range, assumeSorted)$(BR)
|
$(XREF range, assumeSorted)$(BR)
|
||||||
$(XREF range, SortedRange)$(BR)
|
$(XREF range, SortedRange)$(BR)
|
||||||
$(XREF algorithm, SwapStrategy)$(BR)
|
$(XREF_PACK algorithm,mutation,SwapStrategy)$(BR)
|
||||||
$(XREF functional, binaryFun)
|
$(XREF functional, binaryFun)
|
||||||
*/
|
*/
|
||||||
SortedRange!(Range, less)
|
SortedRange!(Range, less)
|
||||||
|
@ -2281,10 +2281,12 @@ Params:
|
||||||
less = A binary predicate that defines the ordering of range elements.
|
less = A binary predicate that defines the ordering of range elements.
|
||||||
Defaults to $(D a < b).
|
Defaults to $(D a < b).
|
||||||
ss = $(RED (Not implemented yet.)) Specify the swapping strategy.
|
ss = $(RED (Not implemented yet.)) Specify the swapping strategy.
|
||||||
r = A $(XREF2 range, isRandomAccessRange, random-access range) of elements
|
r = A
|
||||||
to make an index for.
|
$(XREF_PACK_NAMED range,primitives,isRandomAccessRange,random-access range)
|
||||||
index = A $(XREF2 range, isRandomAccessRange, random-access range) with
|
of elements to make an index for.
|
||||||
assignable elements to build the index in. The length of this range
|
index = A
|
||||||
|
$(XREF_PACK_NAMED range,primitives,isRandomAccessRange,random-access range)
|
||||||
|
with assignable elements to build the index in. The length of this range
|
||||||
determines how many top elements to index in $(D r).
|
determines how many top elements to index in $(D r).
|
||||||
|
|
||||||
This index range can either have integral elements, in which case the
|
This index range can either have integral elements, in which case the
|
||||||
|
|
19
std/array.d
19
std/array.d
|
@ -1431,7 +1431,8 @@ delimiter. Runs of whitespace are merged together (no empty words are produced).
|
||||||
$(D @safe), $(D pure) and $(D CTFE)-able.
|
$(D @safe), $(D pure) and $(D CTFE)-able.
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
$(XREF algorithm, splitter) for a version that splits using any separator.
|
$(XREF_PACK algorithm,iteration,splitter) for a version that splits using any
|
||||||
|
separator.
|
||||||
|
|
||||||
$(XREF regex, splitter) for a version that splits using a regular
|
$(XREF regex, splitter) for a version that splits using a regular
|
||||||
expression defined separator.
|
expression defined separator.
|
||||||
|
@ -1523,7 +1524,7 @@ unittest
|
||||||
}
|
}
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Alias for $(XREF algorithm, _splitter).
|
Alias for $(XREF_PACK algorithm,iteration,_splitter).
|
||||||
+/
|
+/
|
||||||
deprecated("Please use std.algorithm.iteration.splitter instead.")
|
deprecated("Please use std.algorithm.iteration.splitter instead.")
|
||||||
alias splitter = std.algorithm.iteration.splitter;
|
alias splitter = std.algorithm.iteration.splitter;
|
||||||
|
@ -1531,9 +1532,10 @@ alias splitter = std.algorithm.iteration.splitter;
|
||||||
/++
|
/++
|
||||||
Eagerly splits $(D range) into an array, using $(D sep) as the delimiter.
|
Eagerly splits $(D range) into an array, using $(D sep) as the delimiter.
|
||||||
|
|
||||||
The range must be a $(XREF2 range, isForwardRange, forward range).
|
The _range must be a
|
||||||
The separator can be a value of the same type as the elements in $(D range) or
|
$(XREF_PACK_NAMED _range,primitives,isForwardRange,forward _range).
|
||||||
it can be another forward range.
|
The separator can be a value of the same type as the elements in $(D range)
|
||||||
|
or it can be another forward _range.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
If $(D range) is a $(D string), $(D sep) can be a $(D char) or another
|
If $(D range) is a $(D string), $(D sep) can be a $(D char) or another
|
||||||
|
@ -1542,7 +1544,7 @@ alias splitter = std.algorithm.iteration.splitter;
|
||||||
The return type will be an array of $(D int) arrays.
|
The return type will be an array of $(D int) arrays.
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
range = a forward range.
|
range = a forward _range.
|
||||||
sep = a value of the same type as the elements of $(D range) or another
|
sep = a value of the same type as the elements of $(D range) or another
|
||||||
forward range.
|
forward range.
|
||||||
|
|
||||||
|
@ -1550,7 +1552,8 @@ alias splitter = std.algorithm.iteration.splitter;
|
||||||
An array containing the divided parts of $(D range).
|
An array containing the divided parts of $(D range).
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
$(XREF algorithm, splitter) for the lazy version of this function.
|
$(XREF_PACK algorithm,iteration,splitter) for the lazy version of this
|
||||||
|
function.
|
||||||
+/
|
+/
|
||||||
auto split(Range, Separator)(Range range, Separator sep)
|
auto split(Range, Separator)(Range range, Separator sep)
|
||||||
if (isForwardRange!Range && is(typeof(ElementType!Range.init == Separator.init)))
|
if (isForwardRange!Range && is(typeof(ElementType!Range.init == Separator.init)))
|
||||||
|
@ -1649,7 +1652,7 @@ private enum bool hasCheapIteration(R) = isArray!R;
|
||||||
an allocated array of Elements
|
an allocated array of Elements
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
$(XREF algorithm, joiner)
|
$(XREF_PACK algorithm,iteration,joiner)
|
||||||
+/
|
+/
|
||||||
ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep)
|
ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep)
|
||||||
if(isInputRange!RoR &&
|
if(isInputRange!RoR &&
|
||||||
|
|
|
@ -6,7 +6,7 @@ This module defines generic containers.
|
||||||
Construction:
|
Construction:
|
||||||
|
|
||||||
To implement the different containers both struct and class based
|
To implement the different containers both struct and class based
|
||||||
approaches have been used. $(XREF container_util, make) allows for
|
approaches have been used. $(XREF_PACK _container,util,make) allows for
|
||||||
uniform construction with either approach.
|
uniform construction with either approach.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -84,7 +84,8 @@ array1 = array2;
|
||||||
array1.removeBack();
|
array1.removeBack();
|
||||||
assert(array2.empty);
|
assert(array2.empty);
|
||||||
---
|
---
|
||||||
It is therefore recommended to always construct containers using $(XREF container_util, make).
|
It is therefore recommended to always construct containers using
|
||||||
|
$(XREF_PACK _container,util,make).
|
||||||
|
|
||||||
This is in fact necessary to put containers into another _container.
|
This is in fact necessary to put containers into another _container.
|
||||||
For example, to construct an $(D Array) of ten empty $(D Array)s, use
|
For example, to construct an $(D Array) of ten empty $(D Array)s, use
|
||||||
|
|
36
std/csv.d
36
std/csv.d
|
@ -309,10 +309,11 @@ enum Malformed
|
||||||
* -------
|
* -------
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* An input range R as defined by $(XREF range, isInputRange). When $(D
|
* An input range R as defined by
|
||||||
* Contents) is a struct, class, or an associative array, the element
|
* $(XREF_PACK range,primitives,isInputRange). When $(D Contents) is a
|
||||||
* type of R is $(D Contents), otherwise the element type of R is itself
|
* struct, class, or an associative array, the element type of R is
|
||||||
* a range with element type $(D Contents).
|
* $(D Contents), otherwise the element type of R is itself a range with
|
||||||
|
* element type $(D Contents).
|
||||||
*
|
*
|
||||||
* Throws:
|
* Throws:
|
||||||
* $(LREF CSVException) When a quote is found in an unquoted field,
|
* $(LREF CSVException) When a quote is found in an unquoted field,
|
||||||
|
@ -383,10 +384,11 @@ auto csvReader(Contents = string,Malformed ErrorLevel = Malformed.throwException
|
||||||
* -------
|
* -------
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* An input range R as defined by $(XREF range, isInputRange). When $(D
|
* An input range R as defined by
|
||||||
* Contents) is a struct, class, or an associative array, the element
|
* $(XREF_PACK range,primitives,isInputRange). When $(D Contents) is a
|
||||||
* type of R is $(D Contents), otherwise the element type of R is itself
|
* struct, class, or an associative array, the element type of R is
|
||||||
* a range with element type $(D Contents).
|
* $(D Contents), otherwise the element type of R is itself a range with
|
||||||
|
* element type $(D Contents).
|
||||||
*
|
*
|
||||||
* The returned range provides a header field for accessing the header
|
* The returned range provides a header field for accessing the header
|
||||||
* from the input in array form.
|
* from the input in array form.
|
||||||
|
@ -948,7 +950,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of an input range as defined by $(XREF range, isInputRange).
|
* Part of an input range as defined by
|
||||||
|
* $(XREF_PACK range,primitives,isInputRange).
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* If $(D Contents) is a struct, will be filled with record data.
|
* If $(D Contents) is a struct, will be filled with record data.
|
||||||
|
@ -979,7 +982,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of an input range as defined by $(XREF range, isInputRange).
|
* Part of an input range as defined by
|
||||||
|
* $(XREF_PACK range,primitives,isInputRange).
|
||||||
*/
|
*/
|
||||||
@property bool empty() @safe @nogc pure nothrow const
|
@property bool empty() @safe @nogc pure nothrow const
|
||||||
{
|
{
|
||||||
|
@ -987,7 +991,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of an input range as defined by $(XREF range, isInputRange).
|
* Part of an input range as defined by
|
||||||
|
* $(XREF_PACK range,primitives,isInputRange).
|
||||||
*
|
*
|
||||||
* Throws:
|
* Throws:
|
||||||
* $(LREF CSVException) When a quote is found in an unquoted field,
|
* $(LREF CSVException) When a quote is found in an unquoted field,
|
||||||
|
@ -1179,7 +1184,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of an input range as defined by $(XREF range, isInputRange).
|
* Part of an input range as defined by
|
||||||
|
* $(XREF_PACK range,primitives,isInputRange).
|
||||||
*/
|
*/
|
||||||
@property Contents front() @safe pure
|
@property Contents front() @safe pure
|
||||||
{
|
{
|
||||||
|
@ -1188,7 +1194,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of an input range as defined by $(XREF range, isInputRange).
|
* Part of an input range as defined by
|
||||||
|
* $(XREF_PACK range,primitives,isInputRange).
|
||||||
*/
|
*/
|
||||||
@property bool empty() @safe pure nothrow @nogc const
|
@property bool empty() @safe pure nothrow @nogc const
|
||||||
{
|
{
|
||||||
|
@ -1212,7 +1219,8 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of an input range as defined by $(XREF range, isInputRange).
|
* Part of an input range as defined by
|
||||||
|
* $(XREF_PACK range,primitives,isInputRange).
|
||||||
*
|
*
|
||||||
* Throws:
|
* Throws:
|
||||||
* $(LREF CSVException) When a quote is found in an unquoted field,
|
* $(LREF CSVException) When a quote is found in an unquoted field,
|
||||||
|
|
|
@ -25,10 +25,11 @@ $(TR $(TDNW Helpers) $(TD $(MYREF crcHexString) $(MYREF crc32Of))
|
||||||
* module.
|
* module.
|
||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
* CRCs are usually printed with the MSB first. When using $(XREF digest.digest, toHexString) the result
|
* CRCs are usually printed with the MSB first. When using
|
||||||
* will be in an unexpected order. Use $(XREF digest.digest, toHexString)s optional order parameter
|
* $(XREF_PACK digest,digest,toHexString) the result will be in an unexpected
|
||||||
* to specify decreasing order for the correct result. The $(LREF crcHexString) alias can also
|
* order. Use $(XREF_PACK digest,digest,toHexString)'s optional order parameter
|
||||||
* be used for this purpose.
|
* to specify decreasing order for the correct result. The $(LREF crcHexString)
|
||||||
|
* alias can also be used for this purpose.
|
||||||
*
|
*
|
||||||
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
|
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
|
||||||
*
|
*
|
||||||
|
@ -156,8 +157,8 @@ struct CRC32
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
*/
|
*/
|
||||||
void put(scope const(ubyte)[] data...) @trusted pure nothrow @nogc
|
void put(scope const(ubyte)[] data...) @trusted pure nothrow @nogc
|
||||||
{
|
{
|
||||||
|
@ -306,12 +307,13 @@ unittest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a convenience alias for $(XREF digest.digest, digest) using the
|
* This is a convenience alias for $(XREF_PACK digest,digest,digest) using the
|
||||||
* CRC32 implementation.
|
* CRC32 implementation.
|
||||||
*
|
*
|
||||||
* Params:
|
* Params:
|
||||||
* data = $(D InputRange) of $(D ElementType) implicitly convertible to $(D ubyte), $(D ubyte[]) or $(D ubyte[num])
|
* data = $(D InputRange) of $(D ElementType) implicitly convertible to
|
||||||
* or one or more arrays of any type.
|
* $(D ubyte), $(D ubyte[]) or $(D ubyte[num]) or one or more arrays
|
||||||
|
* of any type.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* CRC32 of data
|
* CRC32 of data
|
||||||
|
@ -340,8 +342,8 @@ unittest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a convenience alias for $(XREF digest.digest, toHexString) producing the usual
|
* This is a convenience alias for $(XREF_PACK digest,digest,toHexString)
|
||||||
* CRC32 string output.
|
* producing the usual CRC32 string output.
|
||||||
*/
|
*/
|
||||||
public alias crcHexString = toHexString!(Order.decreasing);
|
public alias crcHexString = toHexString!(Order.decreasing);
|
||||||
///ditto
|
///ditto
|
||||||
|
@ -352,8 +354,8 @@ public alias crcHexString = toHexString!(Order.decreasing, 16);
|
||||||
* OOP API CRC32 implementation.
|
* OOP API CRC32 implementation.
|
||||||
* See $(D std.digest.digest) for differences between template and OOP API.
|
* See $(D std.digest.digest) for differences between template and OOP API.
|
||||||
*
|
*
|
||||||
* This is an alias for $(XREF digest.digest, WrapperDigest)!CRC32, see
|
* This is an alias for $(D $(XREF_PACK digest,digest,WrapperDigest)!CRC32), see
|
||||||
* $(XREF digest.digest, WrapperDigest) for more information.
|
* there for more information.
|
||||||
*/
|
*/
|
||||||
alias CRC32Digest = WrapperDigest!CRC32;
|
alias CRC32Digest = WrapperDigest!CRC32;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* This module describes the digest APIs used in Phobos. All digests follow these APIs.
|
* This module describes the _digest APIs used in Phobos. All digests follow
|
||||||
* Additionally, this module contains useful helper methods which can be used with every _digest type.
|
* these APIs. Additionally, this module contains useful helper methods which
|
||||||
|
* can be used with every _digest type.
|
||||||
*
|
*
|
||||||
$(SCRIPT inhibitQuickIndex = 1;)
|
$(SCRIPT inhibitQuickIndex = 1;)
|
||||||
|
|
||||||
|
@ -202,9 +203,10 @@ version(ExampleDigest)
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
* The following usages of $(D put) must work for any type which passes $(LREF isDigest):
|
* The following usages of $(D put) must work for any type which
|
||||||
|
* passes $(LREF isDigest):
|
||||||
* Examples:
|
* Examples:
|
||||||
* ----
|
* ----
|
||||||
* ExampleDigest dig;
|
* ExampleDigest dig;
|
||||||
|
@ -540,8 +542,8 @@ interface Digest
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* ----
|
* ----
|
||||||
|
@ -837,8 +839,8 @@ class WrapperDigest(T) if(isDigest!T) : Digest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
*/
|
*/
|
||||||
@trusted nothrow void put(scope const(ubyte)[] data...)
|
@trusted nothrow void put(scope const(ubyte)[] data...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -286,8 +286,8 @@ struct MD5
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* ----
|
* ----
|
||||||
|
@ -490,7 +490,7 @@ unittest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a convenience alias for $(XREF digest.digest, digest) using the
|
* This is a convenience alias for $(XREF_PACK digest,digest,digest) using the
|
||||||
* MD5 implementation.
|
* MD5 implementation.
|
||||||
*/
|
*/
|
||||||
//simple alias doesn't work here, hope this gets inlined...
|
//simple alias doesn't work here, hope this gets inlined...
|
||||||
|
@ -510,8 +510,8 @@ unittest
|
||||||
* OOP API MD5 implementation.
|
* OOP API MD5 implementation.
|
||||||
* See $(D std.digest.digest) for differences between template and OOP API.
|
* See $(D std.digest.digest) for differences between template and OOP API.
|
||||||
*
|
*
|
||||||
* This is an alias for $(XREF digest.digest, WrapperDigest)!MD5, see
|
* This is an alias for $(D $(XREF_PACK digest,digest,WrapperDigest)!MD5), see
|
||||||
* $(XREF digest.digest, WrapperDigest) for more information.
|
* there for more information.
|
||||||
*/
|
*/
|
||||||
alias MD5Digest = WrapperDigest!MD5;
|
alias MD5Digest = WrapperDigest!MD5;
|
||||||
|
|
||||||
|
|
|
@ -442,8 +442,8 @@ struct RIPEMD160
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* ----
|
* ----
|
||||||
|
@ -659,7 +659,7 @@ unittest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a convenience alias for $(XREF digest.digest, digest) using the
|
* This is a convenience alias for $(XREF_PACK digest,digest,digest) using the
|
||||||
* RIPEMD160 implementation.
|
* RIPEMD160 implementation.
|
||||||
*/
|
*/
|
||||||
//simple alias doesn't work here, hope this gets inlined...
|
//simple alias doesn't work here, hope this gets inlined...
|
||||||
|
@ -679,8 +679,8 @@ unittest
|
||||||
* OOP API RIPEMD160 implementation.
|
* OOP API RIPEMD160 implementation.
|
||||||
* See $(D std.digest.digest) for differences between template and OOP API.
|
* See $(D std.digest.digest) for differences between template and OOP API.
|
||||||
*
|
*
|
||||||
* This is an alias for $(XREF digest.digest, WrapperDigest)!RIPEMD160, see
|
* This is an alias for $(D $(XREF_PACK digest,digest,WrapperDigest)!RIPEMD160),
|
||||||
* $(XREF digest.digest, WrapperDigest) for more information.
|
* see there for more information.
|
||||||
*/
|
*/
|
||||||
alias RIPEMD160Digest = WrapperDigest!RIPEMD160;
|
alias RIPEMD160Digest = WrapperDigest!RIPEMD160;
|
||||||
|
|
||||||
|
|
|
@ -688,8 +688,8 @@ struct SHA(int blockSize, int digestSize)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this to feed the digest with data.
|
* Use this to feed the digest with data.
|
||||||
* Also implements the $(XREF range, OutputRange) interface for $(D ubyte) and
|
* Also implements the $(XREF_PACK range,primitives,isOutputRange)
|
||||||
* $(D const(ubyte)[]).
|
* interface for $(D ubyte) and $(D const(ubyte)[]).
|
||||||
*/
|
*/
|
||||||
void put(scope const(ubyte)[] input...) @trusted pure nothrow @nogc
|
void put(scope const(ubyte)[] input...) @trusted pure nothrow @nogc
|
||||||
{
|
{
|
||||||
|
@ -1093,7 +1093,7 @@ unittest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These are convenience aliases for $(XREF digest.digest, digest) using the
|
* These are convenience aliases for $(XREF_PACK digest,digest,digest) using the
|
||||||
* SHA implementation.
|
* SHA implementation.
|
||||||
*/
|
*/
|
||||||
//simple alias doesn't work here, hope this gets inlined...
|
//simple alias doesn't work here, hope this gets inlined...
|
||||||
|
@ -1172,8 +1172,8 @@ unittest
|
||||||
* OOP API SHA1 and SHA2 implementations.
|
* OOP API SHA1 and SHA2 implementations.
|
||||||
* See $(D std.digest.digest) for differences between template and OOP API.
|
* See $(D std.digest.digest) for differences between template and OOP API.
|
||||||
*
|
*
|
||||||
* This is an alias for $(XREF digest.digest, WrapperDigest)!SHA1, see
|
* This is an alias for $(D $(XREF_PACK digest,digest,WrapperDigest)!SHA1), see
|
||||||
* $(XREF digest.digest, WrapperDigest) for more information.
|
* there for more information.
|
||||||
*/
|
*/
|
||||||
alias SHA1Digest = WrapperDigest!SHA1;
|
alias SHA1Digest = WrapperDigest!SHA1;
|
||||||
alias SHA224Digest = WrapperDigest!SHA224; ///ditto
|
alias SHA224Digest = WrapperDigest!SHA224; ///ditto
|
||||||
|
|
|
@ -1664,9 +1664,9 @@ Returns: A wrapper $(D struct) that preserves the range interface of $(D input).
|
||||||
opSlice:
|
opSlice:
|
||||||
Infinite ranges with slicing support must return an instance of
|
Infinite ranges with slicing support must return an instance of
|
||||||
$(XREF range, Take) when sliced with a specific lower and upper
|
$(XREF range, Take) when sliced with a specific lower and upper
|
||||||
bound (see $(XREF range_primitives, hasSlicing)); $(D handle) deals with this
|
bound (see $(XREF_PACK range,primitives,hasSlicing)); $(D handle) deals with
|
||||||
by $(D take)ing 0 from the return value of the handler function and returning
|
this by $(D take)ing 0 from the return value of the handler function and
|
||||||
that when an exception is caught.
|
returning that when an exception is caught.
|
||||||
*/
|
*/
|
||||||
auto handle(E : Throwable, RangePrimitive primitivesToHandle, alias handler, Range)(Range input)
|
auto handle(E : Throwable, RangePrimitive primitivesToHandle, alias handler, Range)(Range input)
|
||||||
if (isInputRange!Range)
|
if (isInputRange!Range)
|
||||||
|
|
|
@ -107,7 +107,7 @@ private alias enforceFmt = enforceEx!FormatException;
|
||||||
Interprets variadic argument list $(D args), formats them according
|
Interprets variadic argument list $(D args), formats them according
|
||||||
to $(D fmt), and sends the resulting characters to $(D w). The
|
to $(D fmt), and sends the resulting characters to $(D w). The
|
||||||
encoding of the output is the same as $(D Char). The type $(D Writer)
|
encoding of the output is the same as $(D Char). The type $(D Writer)
|
||||||
must satisfy $(XREF range,isOutputRange!(Writer, Char)).
|
must satisfy $(D $(XREF_PACK range,primitives,isOutputRange)!(Writer, Char)).
|
||||||
|
|
||||||
The variadic arguments are normally consumed in order. POSIX-style
|
The variadic arguments are normally consumed in order. POSIX-style
|
||||||
$(WEB opengroup.org/onlinepubs/009695399/functions/printf.html,
|
$(WEB opengroup.org/onlinepubs/009695399/functions/printf.html,
|
||||||
|
|
|
@ -1563,13 +1563,15 @@ public:
|
||||||
Eager parallel map. The eagerness of this function means it has less
|
Eager parallel map. The eagerness of this function means it has less
|
||||||
overhead than the lazily evaluated $(D TaskPool.map) and should be
|
overhead than the lazily evaluated $(D TaskPool.map) and should be
|
||||||
preferred where the memory requirements of eagerness are acceptable.
|
preferred where the memory requirements of eagerness are acceptable.
|
||||||
$(D functions) are the functions to be evaluated, passed as template alias
|
$(D functions) are the functions to be evaluated, passed as template
|
||||||
parameters in a style similar to $(XREF algorithm, map). The first
|
alias parameters in a style similar to
|
||||||
argument must be a random access range. For performance reasons, amap
|
$(XREF_PACK algorithm,iteration,map).
|
||||||
will assume the range elements have not yet been initialized. Elements will
|
The first argument must be a random access range. For performance
|
||||||
be overwritten without calling a destructor nor doing an assignment. As such,
|
reasons, amap will assume the range elements have not yet been
|
||||||
the range must not contain meaningful data: either un-initialized objects, or
|
initialized. Elements will be overwritten without calling a destructor
|
||||||
objects in their $(D .init) state.
|
nor doing an assignment. As such, the range must not contain meaningful
|
||||||
|
data: either un-initialized objects, or objects in their $(D .init)
|
||||||
|
state.
|
||||||
|
|
||||||
---
|
---
|
||||||
auto numbers = iota(100_000_000.0);
|
auto numbers = iota(100_000_000.0);
|
||||||
|
@ -2345,15 +2347,16 @@ public:
|
||||||
template reduce(functions...)
|
template reduce(functions...)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
Parallel reduce on a random access range. Except as otherwise noted, usage
|
Parallel reduce on a random access range. Except as otherwise noted,
|
||||||
is similar to $(XREF algorithm, _reduce). This function works by splitting
|
usage is similar to $(XREF_PACK algorithm,iteration,_reduce). This
|
||||||
the range to be reduced into work units, which are slices to be reduced in
|
function works by splitting the range to be reduced into work units,
|
||||||
parallel. Once the results from all work units are computed, a final serial
|
which are slices to be reduced in parallel. Once the results from all
|
||||||
reduction is performed on these results to compute the final answer.
|
work units are computed, a final serial reduction is performed on these
|
||||||
Therefore, care must be taken to choose the seed value appropriately.
|
results to compute the final answer. Therefore, care must be taken to
|
||||||
|
choose the seed value appropriately.
|
||||||
|
|
||||||
Because the reduction is being performed in parallel,
|
Because the reduction is being performed in parallel, $(D functions)
|
||||||
$(D functions) must be associative. For notational simplicity, let # be an
|
must be associative. For notational simplicity, let # be an
|
||||||
infix operator representing $(D functions). Then, (a # b) # c must equal
|
infix operator representing $(D functions). Then, (a # b) # c must equal
|
||||||
a # (b # c). Floating point addition is not associative
|
a # (b # c). Floating point addition is not associative
|
||||||
even though addition in exact arithmetic is. Summing floating
|
even though addition in exact arithmetic is. Summing floating
|
||||||
|
@ -2361,20 +2364,21 @@ public:
|
||||||
serially. However, for many practical purposes floating point addition
|
serially. However, for many practical purposes floating point addition
|
||||||
can be treated as associative.
|
can be treated as associative.
|
||||||
|
|
||||||
Note that, since $(D functions) are assumed to be associative, additional
|
Note that, since $(D functions) are assumed to be associative,
|
||||||
optimizations are made to the serial portion of the reduction algorithm.
|
additional optimizations are made to the serial portion of the reduction
|
||||||
These take advantage of the instruction level parallelism of modern CPUs,
|
algorithm. These take advantage of the instruction level parallelism of
|
||||||
in addition to the thread-level parallelism that the rest of this
|
modern CPUs, in addition to the thread-level parallelism that the rest
|
||||||
module exploits. This can lead to better than linear speedups relative
|
of this module exploits. This can lead to better than linear speedups
|
||||||
to $(XREF algorithm, _reduce), especially for fine-grained benchmarks
|
relative to $(XREF_PACK algorithm,iteration,_reduce), especially for
|
||||||
like dot products.
|
fine-grained benchmarks like dot products.
|
||||||
|
|
||||||
An explicit seed may be provided as the first argument. If
|
An explicit seed may be provided as the first argument. If
|
||||||
provided, it is used as the seed for all work units and for the final
|
provided, it is used as the seed for all work units and for the final
|
||||||
reduction of results from all work units. Therefore, if it is not the
|
reduction of results from all work units. Therefore, if it is not the
|
||||||
identity value for the operation being performed, results may differ from
|
identity value for the operation being performed, results may differ
|
||||||
those generated by $(XREF algorithm, _reduce) or depending on how many work
|
from those generated by $(XREF_PACK algorithm,iteration,_reduce) or
|
||||||
units are used. The next argument must be the range to be reduced.
|
depending on how many work units are used. The next argument must be
|
||||||
|
the range to be reduced.
|
||||||
---
|
---
|
||||||
// Find the sum of squares of a range in parallel, using
|
// Find the sum of squares of a range in parallel, using
|
||||||
// an explicit seed.
|
// an explicit seed.
|
||||||
|
|
|
@ -2781,12 +2781,14 @@ an entire $(D front)/$(D popFront)/$(D empty) structure.
|
||||||
$(D fun) maybe be passed either a template alias parameter (existing
|
$(D fun) maybe be passed either a template alias parameter (existing
|
||||||
function, delegate, struct type defining static $(D opCall)... ) or
|
function, delegate, struct type defining static $(D opCall)... ) or
|
||||||
a run-time value argument (delegate, function object... ).
|
a run-time value argument (delegate, function object... ).
|
||||||
The result range models an InputRange ($(XREF range, isInputRange)).
|
The result range models an InputRange
|
||||||
|
($(XREF_PACK range,primitives,isInputRange)).
|
||||||
The resulting range will call $(D fun()) on every call to $(D front),
|
The resulting range will call $(D fun()) on every call to $(D front),
|
||||||
and only when $(D front) is called, regardless of how the range is
|
and only when $(D front) is called, regardless of how the range is
|
||||||
iterated.
|
iterated.
|
||||||
It is advised to compose generate with either $(XREF algorithm,cache)
|
It is advised to compose generate with either
|
||||||
or $(XREF array,array), or to use it in a foreach loop.
|
$(XREF_PACK algorithm,iteration,cache) or $(XREF array,array), or to use it in a
|
||||||
|
foreach loop.
|
||||||
A by-value foreach loop means that the loop value is not $(D ref).
|
A by-value foreach loop means that the loop value is not $(D ref).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
|
@ -7155,10 +7157,10 @@ enum SearchPolicy
|
||||||
Represents a sorted range. In addition to the regular range
|
Represents a sorted range. In addition to the regular range
|
||||||
primitives, supports additional operations that take advantage of the
|
primitives, supports additional operations that take advantage of the
|
||||||
ordering, such as merge and binary search. To obtain a $(D
|
ordering, such as merge and binary search. To obtain a $(D
|
||||||
SortedRange) from an unsorted range $(D r), use $(XREF algorithm,
|
SortedRange) from an unsorted range $(D r), use
|
||||||
sort) which sorts $(D r) in place and returns the corresponding $(D
|
$(XREF_PACK algorithm,sorting,sort) which sorts $(D r) in place and returns the
|
||||||
SortedRange). To construct a $(D SortedRange) from a range $(D r) that
|
corresponding $(D SortedRange). To construct a $(D SortedRange) from a range
|
||||||
is known to be already sorted, use $(LREF assumeSorted) described
|
$(D r) that is known to be already sorted, use $(LREF assumeSorted) described
|
||||||
below.
|
below.
|
||||||
*/
|
*/
|
||||||
struct SortedRange(Range, alias pred = "a < b")
|
struct SortedRange(Range, alias pred = "a < b")
|
||||||
|
@ -7787,7 +7789,7 @@ effect on the complexity of subsequent operations specific to sorted
|
||||||
ranges (such as binary search). The probability of an arbitrary
|
ranges (such as binary search). The probability of an arbitrary
|
||||||
unsorted range failing the test is very high (however, an
|
unsorted range failing the test is very high (however, an
|
||||||
almost-sorted range is likely to pass it). To check for sortedness at
|
almost-sorted range is likely to pass it). To check for sortedness at
|
||||||
cost $(BIGOH n), use $(XREF algorithm,isSorted).
|
cost $(BIGOH n), use $(XREF_PACK algorithm,sorting,isSorted).
|
||||||
*/
|
*/
|
||||||
auto assumeSorted(alias pred = "a < b", R)(R r)
|
auto assumeSorted(alias pred = "a < b", R)(R r)
|
||||||
if (isInputRange!(Unqual!R))
|
if (isInputRange!(Unqual!R))
|
||||||
|
@ -8679,7 +8681,7 @@ struct NullSink
|
||||||
in the case of the version of $(D tee) that takes a function, the function
|
in the case of the version of $(D tee) that takes a function, the function
|
||||||
will not actually be executed until the range is "walked" using functions
|
will not actually be executed until the range is "walked" using functions
|
||||||
that evaluate ranges, such as $(XREF array,array) or
|
that evaluate ranges, such as $(XREF array,array) or
|
||||||
$(XREF algorithm,reduce).
|
$(XREF_PACK algorithm,iteration,reduce).
|
||||||
|
|
||||||
Params:
|
Params:
|
||||||
pipeOnPop = If `Yes.pipeOnPop`, simply iterating the range without ever
|
pipeOnPop = If `Yes.pipeOnPop`, simply iterating the range without ever
|
||||||
|
@ -8699,7 +8701,7 @@ struct NullSink
|
||||||
iterated and returns its elements in turn. In addition, the same elements
|
iterated and returns its elements in turn. In addition, the same elements
|
||||||
will be passed to `outputRange` or `fun` as well.
|
will be passed to `outputRange` or `fun` as well.
|
||||||
|
|
||||||
See_Also: $(XREF algorithm, each)
|
See_Also: $(XREF_PACK algorithm,iteration,each)
|
||||||
+/
|
+/
|
||||||
auto tee(Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1, R2)(R1 inputRange, R2 outputRange)
|
auto tee(Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1, R2)(R1 inputRange, R2 outputRange)
|
||||||
if (isInputRange!R1 && isOutputRange!(R2, ElementType!R1))
|
if (isInputRange!R1 && isOutputRange!(R2, ElementType!R1))
|
||||||
|
|
|
@ -2269,8 +2269,8 @@ void main()
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
$(XREF algorithm, joiner) can be used to join chunks together into a single
|
$(XREF_PACK algorithm,iteration,joiner) can be used to join chunks together into
|
||||||
range lazily.
|
a single range lazily.
|
||||||
Example:
|
Example:
|
||||||
---
|
---
|
||||||
import std.algorithm, std.stdio;
|
import std.algorithm, std.stdio;
|
||||||
|
|
|
@ -86,10 +86,10 @@ $(TR $(TH Module) $(TH Functions) )
|
||||||
$(LEADINGROW Publicly imported functions)
|
$(LEADINGROW Publicly imported functions)
|
||||||
$(TR $(TD std.algorithm)
|
$(TR $(TD std.algorithm)
|
||||||
$(TD
|
$(TD
|
||||||
$(SHORTXREF algorithm, cmp)
|
$(SHORTXREF_PACK algorithm,comparison,cmp)
|
||||||
$(SHORTXREF algorithm, count)
|
$(SHORTXREF_PACK algorithm,searching,count)
|
||||||
$(SHORTXREF algorithm, endsWith)
|
$(SHORTXREF_PACK algorithm,searching,endsWith)
|
||||||
$(SHORTXREF algorithm, startsWith)
|
$(SHORTXREF_PACK algorithm,searching,startsWith)
|
||||||
))
|
))
|
||||||
$(TR $(TD std.array)
|
$(TR $(TD std.array)
|
||||||
$(TD
|
$(TD
|
||||||
|
@ -134,6 +134,7 @@ See_Also:
|
||||||
|
|
||||||
Macros: WIKI = Phobos/StdString
|
Macros: WIKI = Phobos/StdString
|
||||||
SHORTXREF=$(XREF2 $1, $2, $(TT $2))
|
SHORTXREF=$(XREF2 $1, $2, $(TT $2))
|
||||||
|
SHORTXREF_PACK=$(XREF_PACK_NAMED $2, $(TT $3),$1, $3)
|
||||||
|
|
||||||
Copyright: Copyright Digital Mars 2007-.
|
Copyright: Copyright Digital Mars 2007-.
|
||||||
|
|
||||||
|
|
10
std/uni.d
10
std/uni.d
|
@ -7080,7 +7080,7 @@ unittest
|
||||||
|
|
||||||
See_Also:
|
See_Also:
|
||||||
$(LREF icmp)
|
$(LREF icmp)
|
||||||
$(XREF algorithm, cmp)
|
$(XREF_PACK algorithm,comparison,cmp)
|
||||||
+/
|
+/
|
||||||
int sicmp(S1, S2)(S1 str1, S2 str2)
|
int sicmp(S1, S2)(S1 str1, S2 str2)
|
||||||
if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar)
|
if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar)
|
||||||
|
@ -8981,9 +8981,11 @@ unittest
|
||||||
Certain alphabets like German and Greek have no 1:1
|
Certain alphabets like German and Greek have no 1:1
|
||||||
upper-lower mapping. Use overload of toUpper which takes full string instead.
|
upper-lower mapping. Use overload of toUpper which takes full string instead.
|
||||||
|
|
||||||
toUpper can be used as an argument to $(XREF algorithm, map) to produce an algorithm that can
|
toUpper can be used as an argument to $(XREF_PACK algorithm,iteration,map)
|
||||||
convert a range of characters to upper case without allocating memory.
|
to produce an algorithm that can convert a range of characters to upper case
|
||||||
A string can then be produced by using $(XREF algorithm, copy) to send it to an $(XREF array, appender).
|
without allocating memory.
|
||||||
|
A string can then be produced by using $(XREF_PACK algorithm,mutation,copy)
|
||||||
|
to send it to an $(XREF array, appender).
|
||||||
+/
|
+/
|
||||||
@safe pure nothrow @nogc
|
@safe pure nothrow @nogc
|
||||||
dchar toUpper(dchar c)
|
dchar toUpper(dchar c)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue