mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Improve swap documentation
This commit is contained in:
parent
ed914dfd10
commit
507a30aaab
1 changed files with 8 additions and 1 deletions
|
@ -1927,7 +1927,14 @@ unittest
|
||||||
|
|
||||||
// swap
|
// swap
|
||||||
/**
|
/**
|
||||||
Swaps $(D lhs) and $(D rhs).
|
Swaps $(D lhs) and $(D rhs). The instances $(D lhs) and $(D rhs) are moved in
|
||||||
|
memory, without ever calling $(D opAssign), nor any other function. $(D T)
|
||||||
|
need not be assignable at all to be swapped.
|
||||||
|
|
||||||
|
If $(D lhs) and $(D rhs) reference the same instance, then nothing is done.
|
||||||
|
|
||||||
|
$(D lhs) and $(D rhs) must be mutable. If $(D T) is a struct or union, then
|
||||||
|
its fields must also all be (recursivelly) mutable.
|
||||||
|
|
||||||
Preconditions:
|
Preconditions:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue