Bug in RefCounted?

Maxim Fomin maxim at maxim-fomin.ru
Tue Oct 29 08:47:56 PDT 2013


On Monday, 28 October 2013 at 20:43:01 UTC, Ali Çehreli wrote:
>
> What is the purpose of writeln in that delegate? Obviously, to 
> print 1. Yet it doesn't happen that way. Is this accepted to be 
> a bug? Should the programmer 'new' the object instead?
>
> Ali

In my opinion it is a corner case, a consequence of two things: 
1) need to allocate struct into heap due to lambda 2) need to put 
dtor invocation in the end as usual.


More information about the Digitalmars-d-learn mailing list