mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
std.algorithm: Allow proxySwap-using swap overload to take by ref
This commit is contained in:
parent
2e317d0c5d
commit
9e14a1f6ef
1 changed files with 2 additions and 2 deletions
|
@ -1995,7 +1995,7 @@ See_Also:
|
|||
$(XREF exception, pointsTo)
|
||||
*/
|
||||
void swap(T)(ref T lhs, ref T rhs) @trusted pure nothrow
|
||||
if (allMutableFields!T && !is(typeof(T.init.proxySwap(T.init))))
|
||||
if (allMutableFields!T && !is(typeof(lhs.proxySwap(rhs))))
|
||||
{
|
||||
static if (hasElaborateAssign!T || !isAssignable!T)
|
||||
{
|
||||
|
@ -2039,7 +2039,7 @@ if (allMutableFields!T && !is(typeof(T.init.proxySwap(T.init))))
|
|||
}
|
||||
|
||||
// Not yet documented
|
||||
void swap(T)(T lhs, T rhs) if (is(typeof(T.init.proxySwap(T.init))))
|
||||
void swap(T)(ref T lhs, ref T rhs) if (is(typeof(lhs.proxySwap(rhs))))
|
||||
{
|
||||
lhs.proxySwap(rhs);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue