move

Moves source into target.

Specifically:

  • Does nothing if &source is &target (for the first overload only).
  • Destroys target if needed (for the first overload only, see $(STDREF traits, hasElaborateDestructor))
  • Bitwise copies source into target.
  • If hasElaborateCopyConstructor!T || hasElaborateDestructor!T is true (see $(STDREF traits, hasElaborateCopyConstructor)), then sets source to T.init.

See also $(STDREF exception, doesPointTo).

Preconditions: &source == &target || !doesPointTo(source, source)

  1. void move(T source, T target)
  2. T move(T source)
    T
    move
    (
    T
    )
    (
    ref T source
    )

Meta