move

Undocumented in source. Be warned that the author may not have intended to support it.
@nogc nothrow pragma(inline, true)
void
move
(
T
bool makeSourceInit = true
bool destroyDest = true
)
(
scope ref T source
,
scope return ref T dest
)

Examples

// int postblitCount;
// int dtorCount;
// struct S
// {
//     @nogc nothrow:
//     int value;
//     this(this){ postblitCount++; }
//     ~this(){ if(value > 0) dtorCount++; }
// }

// S a = S(20);
// S b = S(40);

// assert(postblitCount == 0 && dtorCount == 0);
// move(a, b);
// assert(dtorCount == 1);
// assert(postblitCount == 0);
// assert(a == S.init);
// assert(b.value == 20);

Meta