What is the point of D_Version2

Witold Baryluk baryluk at smp.if.uj.edu.pl
Sun Sep 2 07:16:21 PDT 2007


Dnia Sun, 2 Sep 2007 22:50:32 +1000
Derek Parnell <derek at psych.ward> napisał/a:

> 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?

Unfortunetly this is correct behavior.
Even when D_Version2 is undefined, anything which is inside must be
syntacticly correct. const(wchar) is incorrect for D1.

:/
-- 
Witold Baryluk, aleph0
MAIL: baryluk at smp.if.uj.edu.pl
JID: movax at jabber.autocom.pl


More information about the Digitalmars-d-learn mailing list