cast(immutable) vs extra variable

Daniel Davidson nospam at spam.com
Mon Sep 23 06:34:20 PDT 2013


On Sunday, 22 September 2013 at 17:26:01 UTC, Ali Çehreli wrote:
> You are not alone. I tried to answer some of these questions in 
> my DConf 2013 talk. I think I have only scratched the surface:
>
>   http://dconf.org/talks/cehreli.html
>
> Ali

Ali, thank you for providing great feedback and suggestions. I've 
stepped away from D for several months and just getting back into 
it. I will try to out the use of pure when returning data that is 
to be passed into immutable contexts.

Regarding, "the why not make this a pointer as well?" for 
immutable(Portfolio)* portfolio - that might be good to consider. 
So far I have not used pointers in D directly - so just to be 
sure, my use of a direct pointer ensures that even if my one 
pointer is the last remaining reference to the data, it will not 
be garbage collected?

I really enjoyed your talk the first time at D Conf. Now I'm 
enjoying it again online. Thanks.


More information about the Digitalmars-d-learn mailing list