mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 14:10:30 +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`.
|
||||
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
|
||||
if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs))))
|
||||
{
|
||||
|
@ -3121,13 +3128,6 @@ if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs))))
|
|||
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`,
|
||||
specified by their indices `i1` and `i2`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue