On Tuesday, 3 December 2013 at 08:28:23 UTC, Ali Çehreli wrote:
That works for some types as both enum and immutable have their
problems:
* enum is no good for arrays and AAs as it is very likely to be
unnecessarily slow.
* immutable is no good for types that contain mutable
references at least during assignment:
struct S
{
int i;
int[] others;
}
void main()
{
auto a = S(42);
immutable b = a;
// Error: cannot implicitly convert expression (a) of type S to
immutable(S)
}
Kenji is working on this
http://wiki.dlang.org/DIP49
> It is C++ism like follwoing code:
>
> struct S { public: this(type){} ... }
>
> or
>
> static Type t; // in module scope
Both of those do happen. ;)
Ali
Yes, this isn't good at all.