Skip to content

Commit 31cf21b

Browse files
committed
Group documentation in std.algorithm.mutation
1 parent afa7d58 commit 31cf21b

File tree

1 file changed

+22
-31
lines changed

1 file changed

+22
-31
lines changed

std/algorithm/mutation.d

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -541,12 +541,22 @@ $(HTTP sgi.com/tech/stl/copy_backward.html, STL's copy_backward'):
541541
/**
542542
Assigns `value` to each element of input _range `range`.
543543
544+
Alternatively, instead of using a single `value` to fill the `range`,
545+
a `filter` $(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives)
546+
can be provided. The length of `filler` and `range` do not need to match, but
547+
`filler` must not be empty.
548+
544549
Params:
545550
range = An
546551
$(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
547552
that exposes references to its elements and has assignable
548553
elements
549554
value = Assigned to each element of range
555+
filler = A
556+
$(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives)
557+
representing the _fill pattern.
558+
559+
Throws: If `filler` is empty.
550560
551561
See_Also:
552562
$(LREF uninitializedFill)
@@ -712,18 +722,7 @@ if ((isInputRange!Range && is(typeof(range.front = value)) ||
712722
}
713723
}
714724

715-
/**
716-
Fills `range` with a pattern copied from `filler`. The length of
717-
`range` does not have to be a multiple of the length of $(D
718-
filler). If `filler` is empty, an exception is thrown.
719-
720-
Params:
721-
range = An $(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
722-
that exposes references to its elements and has assignable elements.
723-
filler = The
724-
$(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives)
725-
representing the _fill pattern.
726-
*/
725+
/// ditto
727726
void fill(InputRange, ForwardRange)(InputRange range, ForwardRange filler)
728727
if (isInputRange!InputRange
729728
&& (isForwardRange!ForwardRange
@@ -2181,14 +2180,19 @@ if (isBidirectionalRange!Range
21812180

21822181
// reverse
21832182
/**
2184-
Reverses `r` in-place. Performs `r.length / 2` evaluations of $(D
2185-
swap).
2183+
Reverses `r` in-place. Performs `r.length / 2` evaluations of `swap`.
2184+
UTF sequences consisting of multiple code units are preserved properly.
2185+
21862186
Params:
21872187
r = a $(REF_ALTTEXT bidirectional range, isBidirectionalRange, std,range,primitives)
2188-
with swappable elements or a random access range with a length member
2188+
with either swappable elements, a random access range with a length member,
2189+
or a narrow string
21892190
2190-
See_Also:
2191-
$(HTTP sgi.com/tech/stl/_reverse.html, STL's _reverse), $(REF retro, std,range) for a lazy reversed range view
2191+
Note:
2192+
When passing a string with unicode modifiers on characters, such as `\u0301`,
2193+
this function will not properly keep the position of the modifier. For example,
2194+
reversing `ba\u0301d` ("bád") will result in d\u0301ab ("d́ab") instead of
2195+
`da\u0301b` ("dáb").
21922196
*/
21932197
void reverse(Range)(Range r)
21942198
if (isBidirectionalRange!Range && !isRandomAccessRange!Range
@@ -2239,20 +2243,7 @@ if (isRandomAccessRange!Range && hasLength!Range)
22392243
assert(range == [3, 2, 1]);
22402244
}
22412245

2242-
/**
2243-
Reverses `r` in-place, where `r` is a narrow string (having
2244-
elements of type `char` or `wchar`). UTF sequences consisting of
2245-
multiple code units are preserved properly.
2246-
2247-
Params:
2248-
s = a narrow string
2249-
2250-
Bugs:
2251-
When passing a sting with unicode modifiers on characters, such as `\u0301`,
2252-
this function will not properly keep the position of the modifier. For example,
2253-
reversing `ba\u0301d` ("bád") will result in d\u0301ab ("d́ab") instead of
2254-
`da\u0301b` ("dáb").
2255-
*/
2246+
///ditto
22562247
void reverse(Char)(Char[] s)
22572248
if (isNarrowString!(Char[]) && !is(Char == const) && !is(Char == immutable))
22582249
{

0 commit comments

Comments
 (0)