What is the point of D_Version2
    torhu 
    no at spam.invalid
       
    Sun Sep  2 15:48:49 PDT 2007
    
    
  
Derek Parnell wrote:
> Okay, I just don't get it.
> 
> This code below doesn't compile in V1 dmd.
> 
> version(D_Version2)
> {
>     alias const(wchar)[] wstring;
>     alias const(dchar)[] dstring;
> }
> else
> {
>     alias char[] string;
>     alias wchar[] wstring;
>     alias dchar[] dstring;
> }
> 
> 
> I can understand why - because the first two alias declarations have
> invalid V1 syntax - but doesn't that make the whole D_Version2 thing
> pointless?
> 
Have you read this thread?  Thomas Kuehne explains how to write code 
that works in both D 1 and 2.
http://www.digitalmars.com/d/archives/digitalmars/D/supporting_DMD-1.016_and_DMD-2.000_with_the_same_source_code_54628.html
    
    
More information about the Digitalmars-d-learn
mailing list