fix package XREFs

Also add escaping underscores in some places, and rewrap to 80 columns
where touching anyway.
This commit is contained in:
anonymous 2015-05-13 23:15:12 +02:00
parent 559038b363
commit b28962635f
19 changed files with 255 additions and 189 deletions

View file

@ -129,7 +129,7 @@ $(D cache) does not provide random access primitives,
as $(D cache) would be unable to cache the random accesses.
If $(D Range) provides 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).
+/
auto cache(Range)(Range range)
@ -1295,7 +1295,8 @@ defaults to $(D "a == b").
Params:
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)),
representing each consecutively unique element and its respective number of
@ -1680,8 +1681,8 @@ unittest
* they appear in the original range.
*
* See_also:
* $(XREF algorithm,group), which collapses adjacent equivalent elements into a
* single element.
* $(LREF group), which collapses adjacent equivalent elements into a single
* element.
*/
auto chunkBy(alias pred, Range)(Range r)
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.
Params:
r = An $(XREF2 range, isInputRange, input range) of input ranges to be
joined.
sep = A $(XREF2 range, isForwardRange, forward range) of element(s) to
serve as separators in the joined range.
r = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of input
ranges to be joined.
sep = A $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) of
element(s) to serve as separators in the joined range.
Returns:
An input range of elements in the joined range. This will be a forward range if
@ -2853,8 +2854,8 @@ below).
Params:
pred = The predicate for comparing each element with the separator,
defaulting to $(D "a == b").
r = The $(XREF2 range, isInputRange, input range) to be split. Must support
slicing and $(D .length).
r = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to be
split. Must support slicing and $(D .length).
s = The element to be treated as the separator between range segments to be
split.
@ -3134,9 +3135,10 @@ empty elements.
Params:
pred = The predicate for comparing each element with the separator,
defaulting to $(D "a == b").
r = The $(XREF2 range, isInputRange, input range) to be split.
s = The $(XREF2 range, isForwardRange, forward range) to be treated as the
separator between segments of $(D r) to be split.
r = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) 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:
The predicate $(D pred) needs to accept an element of $(D r) and an
@ -3442,7 +3444,8 @@ empty elements.
Params:
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:
The predicate $(D isTerminator) needs to accept an element of $(D input).
@ -3688,8 +3691,8 @@ Params:
s = The string to be split.
Returns:
An $(XREF2 range, isInputRange, input range) of slices of the original
string split by whitespace.
An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of slices of
the original string split by whitespace.
+/
auto splitter(C)(C[] s)
if (isSomeChar!C)
@ -3870,14 +3873,17 @@ if (isSomeChar!C)
// 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 +
b)(0, r), $(D sum) uses specialized algorithms to maximize accuracy,
as follows.
$(UL
$(LI If $(D $(XREF range, ElementType)!R) is a floating-point type and $(D R) is a
$(XREF2 range, isRandomAccessRange, random-access range) with length and slicing, then $(D sum) uses the
$(LI If $(D $(XREF_PACK range,primitives,ElementType)!R) is a floating-point
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)
algorithm.)
$(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:
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:
An $(XREF2 range, isInputRange, input range) of consecutively unique
elements in the original range. If $(D r) is also a forward range or
bidirectional range, the returned range will be likewise.
An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) of
consecutively unique elements in the original range. If $(D r) is also a
forward range or bidirectional range, the returned range will be likewise.
*/
auto uniq(alias pred = "a == b", Range)(Range r)
if (isInputRange!Range && is(typeof(binaryFun!pred(r.front, r.front)) == bool))

View file

@ -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:
range = An $(XREF2 range, isInputRange, input range) that exposes references to its elements
and has assignable elements
range = An
$(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
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.
Params:
range = An $(XREF2 range, isInputRange, input range) that exposes
references to its elements and has assignable elements.
filler = The $(XREF2 range, isForwardRange, forward range) representing the
_fill pattern.
range = An $(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
that exposes references to its elements and has assignable elements.
filler = The
$(XREF_PACK_NAMED _range,primitives,isForwardRange,forward _range)
representing the _fill pattern.
*/
void fill(Range1, Range2)(Range1 range, Range2 filler)
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.
Params:
range = An $(XREF2 range, isInputRange, input range) that exposes references to its elements
and has assignable elements
range = An
$(XREF_PACK_NAMED _range,primitives,isInputRange,input _range)
that exposes references to its elements and has assignable
elements
See_Also:
$(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).
Params:
src = An $(XREF2 range, isInputRange, input range) with movable elements.
tgt = An $(XREF2 range, isInputRange, input range) with elements that
elements from $(D src) can be moved into.
src = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) with
movable elements.
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
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.
Params:
src = An $(XREF2 range, isInputRange, input range) with movable elements.
tgt = An $(XREF2 range, isInputRange, input range) with elements that
elements from $(D src) can be moved into.
src = An $(XREF_PACK_NAMED range,primitives,isInputRange,input range) with
movable elements.
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
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
has remained of the same length because all functions in $(D
std.algorithm) only change $(I content), not $(I topology). The value
$(D 8) is repeated because $(XREF algorithm, move) was invoked to move
elements around and on integers $(D move) simply copies the source to
$(D 8) is repeated because $(LREF move) was invoked 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,
simply assign $(D a = remove(a, 1)). The slice will be rebound to the
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).
Params:
range = An $(XREF2 range, isInputRange, input range) that exposes references to its elements
and has assignable elements
range = An
$(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
See_Also:

View file

@ -101,7 +101,7 @@ template all(alias pred = "a")
{
/++
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).
+/
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
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).
+/
bool any(Range)(Range range)
@ -361,9 +361,11 @@ Params:
pred = The predicate to use in comparing elements for commonality. Defaults
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:
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).
Params:
pred = The predicate for determining when to stop counting.
haystack = The $(XREF2 range, isInputRange, input range) to be counted.
needles = Either a single element, or a $(XREF2 range, isForwardRange,
forward range) of elements, to be evaluated in turn against each
haystack = The
$(XREF_PACK_NAMED range,primitives,isInputRange,input range) to be
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.
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:
pred = Predicate to when to stop counting.
haystack = An $(XREF2 range, isInputRange, input range) of elements
to be counted.
haystack = An
$(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)
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
the needle(s).
doesThisEnd = The $(XREF2 range, isBidirectionalRange, bidirectional range)
doesThisEnd = The
$(XREF_PACK_NAMED range,primitives,isBidirectionalRange,bidirectional range)
to check.
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
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.
@ -1456,7 +1465,8 @@ Params:
pred = The predicate for determining if a given element is the one being
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:
@ -1545,9 +1555,11 @@ Params:
pred = The predicate to use for comparing respective elements from the haystack
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:
@ -2174,7 +2186,8 @@ evaluations of $(D pred).
Params:
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:
$(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:
pred = The predicate to use for determining a match.
seq = The $(XREF2 range, isInputRange, input range) to search.
choices = A $(XREF2 range, isForwardRange, forward range) of possible
choices.
seq = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range) to
search.
choices = A $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range)
of possible choices.
Returns:
$(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).
*
* Params:
* haystack = The $(XREF2 range, isForwardRange, forward range) to search in.
* needle = The $(XREF2 range, isForwardRange, forward range) to search for.
* haystack = The
* $(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
* 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:
pred = The predicate that determines whether elements from each respective
range match. Defaults to equality $(D "a == b").
r1 = The $(XREF2 range, isForwardRange, forward range) to move forward.
r2 = The $(XREF2 range, isInputRange, input range) representing the initial
segment of $(D r1) to skip over.
r1 = The $(XREF_PACK_NAMED range,primitives,isForwardRange,forward range) to
move forward.
r2 = The $(XREF_PACK_NAMED range,primitives,isInputRange,input range)
representing the initial segment of $(D r1) to skip over.
Returns:
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
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.
@ -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
(one of) the given needle(s).
Checks whether the given
$(XREF_PACK_NAMED range,primitives,isInputRange,input range) starts with (one
of) the given needle(s).
Params:
@ -3395,17 +3416,19 @@ $(D pred(e, sentinel)) is true.
Params:
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.
openRight = Determines whether the element for which the given predicate is
true should be included in the resulting range ($(D OpenRight.no)), or
not ($(D OpenRight.yes)).
Returns:
An $(XREF2 range, isInputRange, input range) that iterates over the
original range's elements, but ends when the specified predicate becomes
true. If the original range is a $(XREF2 range, isForwardRange, forward
range) or higher, this range will be a forward range.
An $(XREF_PACK_NAMED _range,primitives,isInputRange,input _range) that
iterates over the original range's elements, but ends when the specified
predicate becomes true. If the original range is a
$(XREF_PACK_NAMED _range,primitives,isForwardRange,forward _range) or
higher, this range will be a forward range.
*/
Until!(pred, Range, Sentinel)
until(alias pred = "a == b", Range, Sentinel)

View file

@ -944,7 +944,7 @@ time complexity.
See_Also:
$(XREF range, assumeSorted)$(BR)
$(XREF range, SortedRange)$(BR)
$(XREF algorithm, SwapStrategy)$(BR)
$(XREF_PACK algorithm,mutation,SwapStrategy)$(BR)
$(XREF functional, binaryFun)
*/
SortedRange!(Range, less)
@ -2281,10 +2281,12 @@ Params:
less = A binary predicate that defines the ordering of range elements.
Defaults to $(D a < b).
ss = $(RED (Not implemented yet.)) Specify the swapping strategy.
r = A $(XREF2 range, isRandomAccessRange, random-access range) of elements
to make an index for.
index = A $(XREF2 range, isRandomAccessRange, random-access range) with
assignable elements to build the index in. The length of this range
r = A
$(XREF_PACK_NAMED range,primitives,isRandomAccessRange,random-access range)
of elements to make an index for.
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).
This index range can either have integral elements, in which case the