@disable
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Jan 15 01:13:41 PST 2010
Clemens wrote:
> Andrei Alexandrescu Wrote:
>
>> The main idea is to allow creation of noncopyable types by marking
>> this(this) as @disable.
>
> I must be missing something, but isn't this usually done by making the copy constructor private?
Well one issue is that in D private has module granularity, which means
that inside a given module you could still create objects. That has the
advantage of obviating the need for "friend", but disables the private
constructor idiom.
Andrei
More information about the Digitalmars-d
mailing list