dcollections 1.0 and 2.0a beta released
Michel Fortin
michel.fortin at michelf.com
Sat May 22 05:20:30 PDT 2010
On 2010-05-22 08:16:27 -0400, bearophile <bearophileHUGS at lycos.com> 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
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d-announce
mailing list