Defining a version after it's tested for

Robert Clipsham robert at octarineparrot.com
Thu May 21 12:54:07 PDT 2009


Steven Schveighoffer wrote:
> Versions are intended to be predefined before usage.  It's the same 
> thing as using a variable before it's defined.  The rational is, to flag 
> errors to the user where he thinks forward referencing of versions works.
> 
> Unfortunately, you have to do the following workaround:
> 
> version(BackendFoo) { version=BackendFoo_;}
> else version(BackendBar) { version=BackendBar_;}
> else version(BackendCar) { version=BackendCar_;}
> else
> {
>   version(Windows) {version=BackendFoo_;}
> }
> 
> And now, you must use Backend*_ in your code.  It should work, but it's 
> ugly.
> 
> Maybe Walter has a better method.
> 
> -Steve

Unfortunately I thought this might be the case. Thanks.



More information about the Digitalmars-d mailing list