Const struct syntax

bearophile bearophileHUGS at lycos.com
Tue Aug 30 04:59:04 PDT 2011


Timon Gehr:

> struct Bar {
>      int x;
> }
> static assert(is(typeof(new const(Bar)) == const(Bar)*));
> static assert(is(typeof(new immutable(Bar)) == immutable(Bar)*));
> static assert(is(typeof(const(Bar)(1)) == const(Bar)));
> static assert(is(typeof(immutable(Bar)(1)) == immutable(Bar)));
> 
> And I'd call that a bug.

http://d.puremagic.com/issues/show_bug.cgi?id=6578

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list