On 2010-05-22 08:16:27 -0400, bearophile <[email protected]> said:
Michel Fortin:
Couldn't we just make a struct that cannot be implicitly copied?
The @disable attribute was invented for this purpose too:
struct Foo {
int x;
@disable this(this) {}
}
void main() {
Foo f1;
Foo f2 = f1;
}
That prints:
test.d(7): Error: struct test9.Foo is not copyable because it is
annotated with @disable
Indeed, thanks. I figured it out by myself while you were writing this.
--
Michel Fortin
[email protected]
http://michelf.com/