@@ -541,12 +541,22 @@ $(HTTP sgi.com/tech/stl/copy_backward.html, STL's copy_backward'):
541
541
/**
542
542
Assigns `value` to each element of input _range `range`.
543
543
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
+
544
549
Params:
545
550
range = An
546
551
$(REF_ALTTEXT input _range, isInputRange, std,_range,primitives)
547
552
that exposes references to its elements and has assignable
548
553
elements
549
554
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.
550
560
551
561
See_Also:
552
562
$(LREF uninitializedFill)
@@ -712,18 +722,7 @@ if ((isInputRange!Range && is(typeof(range.front = value)) ||
712
722
}
713
723
}
714
724
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
727
726
void fill (InputRange, ForwardRange)(InputRange range, ForwardRange filler)
728
727
if (isInputRange! InputRange
729
728
&& (isForwardRange! ForwardRange
@@ -2181,14 +2180,19 @@ if (isBidirectionalRange!Range
2181
2180
2182
2181
// reverse
2183
2182
/**
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
+
2186
2186
Params:
2187
2187
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
2189
2190
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").
2192
2196
*/
2193
2197
void reverse (Range )(Range r)
2194
2198
if (isBidirectionalRange! Range && ! isRandomAccessRange! Range
@@ -2239,20 +2243,7 @@ if (isRandomAccessRange!Range && hasLength!Range)
2239
2243
assert (range == [3 , 2 , 1 ]);
2240
2244
}
2241
2245
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
2256
2247
void reverse (Char)(Char[] s)
2257
2248
if (isNarrowString! (Char[]) && ! is (Char == const ) && ! is (Char == immutable ))
2258
2249
{
0 commit comments