Comment #1 by razvan.nitu1305 — 2019-05-23T11:32:39Z
Once a postblit is defined (even if it is marked @disable) all copy constructors are ignored (in the sense that the compiler will not insert calls to them; the copy constructors can still be called explicitly).
In this specific situation, disabling the postblit in a member field will make the struct uncopyable, which is the correct behavior. If you want to make A uncopyable but still, have Move(T) copyable, simply use only copy constructors:
struct Move(T) {
private:
import std.algorithm : move;
T storage;
public:
this(ref return scope Move rhs) {}
}
struct A {
@disable this(ref A);
}
void main() {
Move!A x;
Move!A y = x;
}