mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
swapRanges and reverse should be @safe
This commit is contained in:
parent
426bc40535
commit
ad6bd732b3
1 changed files with 5 additions and 5 deletions
|
@ -8760,7 +8760,7 @@ swapRanges(Range1, Range2)(Range1 r1, Range2 r2)
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
int[] a = [ 100, 101, 102, 103 ];
|
int[] a = [ 100, 101, 102, 103 ];
|
||||||
int[] b = [ 0, 1, 2, 3 ];
|
int[] b = [ 0, 1, 2, 3 ];
|
||||||
|
@ -8792,7 +8792,7 @@ if (isBidirectionalRange!Range && !isRandomAccessRange!Range
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
int[] arr = [ 1, 2, 3 ];
|
int[] arr = [ 1, 2, 3 ];
|
||||||
reverse(arr);
|
reverse(arr);
|
||||||
|
@ -8812,7 +8812,7 @@ if (isRandomAccessRange!Range && hasLength!Range)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
debug(std_algorithm) scope(success)
|
debug(std_algorithm) scope(success)
|
||||||
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
|
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
|
||||||
|
@ -8858,14 +8858,14 @@ if (isNarrowString!(Char[]) && !is(Char == const) && !is(Char == immutable))
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
char[] arr = "hello\U00010143\u0100\U00010143".dup;
|
char[] arr = "hello\U00010143\u0100\U00010143".dup;
|
||||||
reverse(arr);
|
reverse(arr);
|
||||||
assert(arr == "\U00010143\u0100\U00010143olleh");
|
assert(arr == "\U00010143\u0100\U00010143olleh");
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
void test(string a, string b)
|
void test(string a, string b)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue