D safety! New Feature?

H.Loom via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 5 09:02:18 PDT 2016


On Thursday, 4 August 2016 at 18:22:52 UTC, Mark "J" Twain wrote:
> Building immutability in to the type system itself allows the 
> programmer to make immutable smarter and control exactly what 
> it does.

once again it is in the type system:

°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
struct Queue{}
alias ImmutQueue = immutable(Queue);

unittest
{
     static assert(!is(Queue == ImmutQueue));
}
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°





More information about the Digitalmars-d mailing list