cast(immutable) vs extra variable

Ali Çehreli acehreli at yahoo.com
Mon Sep 23 10:00:10 PDT 2013


On 09/23/2013 06:34 AM, Daniel Davidson wrote:

 > I've stepped away from D for several months and just getting
 > back into it.

 > the first time at D Conf

Actually, I've been thinking about you recently. My apologies for 
forgetting your last name. That's why I couldn't recognize you. :(

 > I will try to out the use of pure when returning data that is
 > to be passed into immutable contexts.

I don't think there is anything wrong with marking as many functions as 
pure. Indeed, the compiler does that for lambdas anyway. I am not sure 
where things are regarding regular functions.

 > 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?

Correct.

Ali



More information about the Digitalmars-d-learn mailing list