Immutability and other attributes, please review

Roman D. Boiko rb at d-coding.com
Fri Jun 15 00:27:32 PDT 2012


On Friday, 15 June 2012 at 06:25:59 UTC, Jacob Carlborg wrote:
> On 2012-06-14 17:32, Roman D. Boiko wrote:
>
>> I agree, just looking how to accomplish my goals. I decided to 
>> get rid
>> of casting, and will store everything on heap. I don't know 
>> how to put a
>> variable of type float to the heap, and thought that it would 
>> be nice to
>> allow the user to pass anything inside, but copy when that is 
>> not an
>> l-value.
>
> Do you really need to put a float on the heap? Just pass it 
> around as a value type, it's not like it's a big struct.
That could be anything. In most cases I'm oversimplifying the 
task. In this particular case I was interested in building 
collections which can store objects or structs using pointers to 
them.


More information about the Digitalmars-d-learn mailing list