cast(!const) proposal

Regan Heath regan at netmail.co.nz
Mon Sep 10 02:46:19 PDT 2007


Lutger wrote:
> I think this is good idea. It will help to find this class of bugs, 
> which although one shouldn't make, if it is there it will be sneaky one.
> 
> Note that if you want to cast the underlying types too it will be quite 
> ugly:
> 
> auto q = cast(long*)cast(!const)p;

What's wrong with:

auto q = cast(!const long*)p;

as the almost opposite of:

auto q = cast(const long*)p;

Regan



More information about the Digitalmars-d mailing list