Immutability and other attributes, please review

Jonathan M Davis jmdavisProg at gmx.com
Thu Jun 14 15:33:31 PDT 2012


On Friday, June 15, 2012 00:24:15 Timon Gehr wrote:
> On 06/14/2012 06:42 PM, Jonathan M Davis wrote:
> > I wish that you could do
> > 
> > auto f = new float(2.1);
> > 
> > and therefore
> > 
> > auto f = new immutable(float)(2.1);
> > 
> > but you can't.
> 
> This seems to be an arbitrary limitation.
> Imho it should be fixed. Probably it was missed because allocating a
> primitive type on the heap is not a very common operation.

I suggested it quite some time ago, and as I recall it was met with a fair bit 
of negativity. I don't remember why or who said what. Maybe Walter could be 
talked into it. I don't know. Personally, I think that it would be the 
perfectly natural way to do it and find it very bizarre that you can't.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list