mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
co-locate overloads of std.algorithm.mutation.swap() (#8951)
This commit is contained in:
parent
1ea91e6674
commit
a51c0eada6
1 changed files with 7 additions and 7 deletions
|
@ -2860,6 +2860,13 @@ Params:
|
||||||
lhs = Data to be swapped with `rhs`.
|
lhs = Data to be swapped with `rhs`.
|
||||||
rhs = Data to be swapped with `lhs`.
|
rhs = Data to be swapped with `lhs`.
|
||||||
*/
|
*/
|
||||||
|
void swap(T)(ref T lhs, ref T rhs)
|
||||||
|
if (is(typeof(lhs.proxySwap(rhs))))
|
||||||
|
{
|
||||||
|
lhs.proxySwap(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// ditto
|
||||||
void swap(T)(ref T lhs, ref T rhs) @trusted pure nothrow @nogc
|
void swap(T)(ref T lhs, ref T rhs) @trusted pure nothrow @nogc
|
||||||
if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs))))
|
if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs))))
|
||||||
{
|
{
|
||||||
|
@ -3121,13 +3128,6 @@ if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs))))
|
||||||
swap(a3, a4);
|
swap(a3, a4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ditto
|
|
||||||
void swap(T)(ref T lhs, ref T rhs)
|
|
||||||
if (is(typeof(lhs.proxySwap(rhs))))
|
|
||||||
{
|
|
||||||
lhs.proxySwap(rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Swaps two elements in-place of a range `r`,
|
Swaps two elements in-place of a range `r`,
|
||||||
specified by their indices `i1` and `i2`.
|
specified by their indices `i1` and `i2`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue