Error about @disabled constructor when there is a custom one

deadalnix deadalnix at gmail.com
Wed Jan 23 04:14:20 PST 2013


On Wednesday, 23 January 2013 at 10:55:43 UTC, Simen Kjaeraas 
wrote:
> On 2013-48-23 11:01, deadalnix <deadalnix at gmail.com> wrote:
>
>> On Wednesday, 23 January 2013 at 10:28:05 UTC, Simen Kjaeraas 
>> wrote:
>>>> NonNull!T bar = something;
>>>> foo(move(bar));
>>>> bar; // bar is null \o/
>>>
>>> Except it isn't.
>>
>> move memcopy T.init . So it will be null.
>
> Try it. Without a destructor, move does not revert to T.init. 
> With a destructor you get this:
>
> src\phobos\std\algorithm.d(1564): Error: variable 
> std.algorithm.move!(NotNull!(int*)).move.empty initializer 
> required for type NotNull!(int*)
> Error: template instance std.algorithm.move!(NotNull!(int*)) 
> error instantiating
>
> This is what @disable this does, and what it's supposed to do.

Ho that is awesome !

Still many way of generating it on the heap, but it seems that 
the stack is getting better !


More information about the Digitalmars-d mailing list