needsMove

True if a T needs to be passed by move instead of value either because it cannot be copied or because it has an elaborate destructor.

Note that __traits(isPOD, T) implies `core.internal.traits.hasElaborateAssign!T || core.internal.traits.hasElaborateDestructor!T`.

@safe
enum bool needsMove(T);

Examples

static assert(!needsMove!char);
static assert(!needsMove!int);
static assert(!needsMove!string);
static assert(!needsMove!(int[]));

struct SomeUncopyable { @disable this(this); }
static assert(needsMove!SomeUncopyable);

struct WithDtor { ~this() {} }
static assert(needsMove!WithDtor);

Meta