Error about @disabled constructor when there is a custom one

Simen Kjaeraas simen.kjaras at gmail.com
Wed Jan 23 02:54:53 PST 2013


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.

-- 
Simen


More information about the Digitalmars-d mailing list