On Sun, 29 Nov 2009 19:15:19 +0100, Tomek Sowiñski <j...@ask.me> wrote:

A is not implicitly castable to immutable(A), only to const(A).

I think it is. This compiles:
immutable a = A(3.4);
But only because it's copied.

Not quite. If you try

immutable(A) a;
a = A(3.4);

you should find that it does not compile. Only because there must be
a way to initialize immutable objects does your example compile.

BTW, the future optimization options are about removing locks or something more?

Removing locks, yes. Also, pure functions take only immutable
(or copied) parameters and may be optimized out if the same function
is called several times with the same parameters. There may be other
optimizations I am not aware of or do not remember OTOH.

--
Simen

Reply via email to