T.init and @disable this

Maxim Fomin maxim at maxim-fomin.ru
Thu Oct 4 10:37:58 PDT 2012


On Thursday, 4 October 2012 at 17:37:58 UTC, Andrej Mitrovic 
wrote:
> On 10/4/12, monarch_dodra <monarchdodra at gmail.com> wrote:
>> I'm trying to find out the exact semantics of
>>
>> @disable this();
>
> Also this still works:
>
> struct Foo
> {
>     @disable this();
> }
>
> void main()
> {
>     Foo foo = Foo();
> }
>
> I really don't know why though.. Isn't this a bug? A workaround 
> in
> user-code is defining a disabled static opCall:
>
> struct Foo
> {
>     @disable this();
>     @disable static void opCall();
> }

http://d.puremagic.com/issues/show_bug.cgi?id=8703



More information about the Digitalmars-d mailing list