@@ -538,12 +538,22 @@ $(HTTP sgi.com/tech/stl/copy_backward.html, STL's copy_backward'):
538
538
/**
539
539
Assigns `value` to each element of input _range `range`.
540
540
541
+ Alternatively, instead of using a single `value` to fill the `range`,
542
+ a `filter` $(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives)
543
+ can be provided. The length of `filler` and `range` do not need to match, but
544
+ `filler` must not be empty.
545
+
541
546
Params:
542
547
range = An
543
548
$(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
544
549
that exposes references to its elements and has assignable
545
550
elements
546
551
value = Assigned to each element of range
552
+ filler = A
553
+ $(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives)
554
+ representing the _fill pattern.
555
+
556
+ Throws: If `filler` is empty.
547
557
548
558
See_Also:
549
559
$(LREF uninitializedFill)
@@ -709,18 +719,7 @@ if ((isInputRange!Range && is(typeof(range.front = value)) ||
709
719
}
710
720
}
711
721
712
- /**
713
- Fills `range` with a pattern copied from `filler`. The length of
714
- `range` does not have to be a multiple of the length of $(D
715
- filler). If `filler` is empty, an exception is thrown.
716
-
717
- Params:
718
- range = An $(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
719
- that exposes references to its elements and has assignable elements.
720
- filler = The
721
- $(REF_ALTTEXT forward _range, isForwardRange, std,_range,primitives)
722
- representing the _fill pattern.
723
- */
722
+ // / ditto
724
723
void fill (InputRange, ForwardRange)(InputRange range, ForwardRange filler)
725
724
if (isInputRange! InputRange
726
725
&& (isForwardRange! ForwardRange
@@ -2178,14 +2177,19 @@ if (isBidirectionalRange!Range
2178
2177
2179
2178
// reverse
2180
2179
/**
2181
- Reverses `r` in-place. Performs `r.length / 2` evaluations of $(D
2182
- swap).
2180
+ Reverses `r` in-place. Performs `r.length / 2` evaluations of `swap`.
2181
+ UTF sequences consisting of multiple code units are preserved properly.
2182
+
2183
2183
Params:
2184
2184
r = a $(REF_ALTTEXT bidirectional range, isBidirectionalRange, std,range,primitives)
2185
- with swappable elements or a random access range with a length member
2185
+ with either swappable elements, a random access range with a length member,
2186
+ or a narrow string
2186
2187
2187
- See_Also:
2188
- $(HTTP sgi.com/tech/stl/_reverse.html, STL's _reverse), $(REF retro, std,range) for a lazy reversed range view
2188
+ Note:
2189
+ When passing a string with unicode modifiers on characters, such as `\u0301`,
2190
+ this function will not properly keep the position of the modifier. For example,
2191
+ reversing `ba\u0301d` ("bád") will result in d\u0301ab ("d́ab") instead of
2192
+ `da\u0301b` ("dáb").
2189
2193
*/
2190
2194
void reverse (Range )(Range r)
2191
2195
if (isBidirectionalRange! Range && ! isRandomAccessRange! Range
@@ -2236,20 +2240,7 @@ if (isRandomAccessRange!Range && hasLength!Range)
2236
2240
assert (range == [3 , 2 , 1 ]);
2237
2241
}
2238
2242
2239
- /**
2240
- Reverses `r` in-place, where `r` is a narrow string (having
2241
- elements of type `char` or `wchar`). UTF sequences consisting of
2242
- multiple code units are preserved properly.
2243
-
2244
- Params:
2245
- s = a narrow string
2246
-
2247
- Bugs:
2248
- When passing a sting with unicode modifiers on characters, such as `\u0301`,
2249
- this function will not properly keep the position of the modifier. For example,
2250
- reversing `ba\u0301d` ("bád") will result in d\u0301ab ("d́ab") instead of
2251
- `da\u0301b` ("dáb").
2252
- */
2243
+ // /ditto
2253
2244
void reverse (Char)(Char[] s)
2254
2245
if (isNarrowString! (Char[]) && ! is (Char == const ) && ! is (Char == immutable ))
2255
2246
{
0 commit comments