Skip to content

Commit

Permalink
Improve swap documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
monarchdodra committed Oct 20, 2013
1 parent ed914df commit 507a30a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion std/algorithm.d
Expand Up @@ -1927,7 +1927,14 @@ unittest

// 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:
Expand Down

0 comments on commit 507a30a

Please sign in to comment.