D2.0: an example of use-case for casting invariant away

Bruno Medeiros brunodomedeiros+spam at com.gmail
Fri Jun 22 16:39:37 PDT 2007


Bruno Medeiros wrote:
> and the value returned cannot be used as an lvalue, but 
> in any case this is just to demonstrate that no new syntax should be 
> required.
> 

Hum, there is a verbose, but effective, way to go around the lvalue 
problem, just simply use unConstType directly:

   char* foo = cast(unConstType!(typeof(cfoo))) cfoo;

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list