Is This a Solution For the Const/Rebindable Issue?

Steven Schveighoffer schveiguy at yahoo.com
Sun Jun 12 22:12:04 PDT 2011


On Mon, 13 Jun 2011 01:09:57 -0400, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:

> No.  final is not a type constructor, so it does not get carried around  
> with the type.
>
> final int i;
>
> assert(typeof(i) == int); // after the declaration, the storage class is  
> gone from the type!
>
> int * ip = &i;

Note, you might be able to forbid this line, but I don't think this works  
well.

-Steve


More information about the Digitalmars-d mailing list