Re: enum and static if

2015-03-12 Thread ketmar via Digitalmars-d-learn
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote: > This code does not work: > > > enum Test { > Foo, > static if (__VERSION__ >= 2067) > Bar, > } > Quatz > } > > > Any chance that this could work? nope. `static if` is statement, so it works only where statement is

Re: enum and static if

2015-03-11 Thread Nicolas Sicard via Digitalmars-d-learn
On Wednesday, 11 March 2015 at 17:19:20 UTC, ketmar wrote: On Wed, 11 Mar 2015 18:17:38 +0100, Artur Skawina via Digitalmars-d-learn wrote: On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote: On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote: On Wednesday, 11 March 2015 at 14:34:32 UTC

Re: enum and static if

2015-03-11 Thread ketmar via Digitalmars-d-learn
On Wed, 11 Mar 2015 18:17:38 +0100, Artur Skawina via Digitalmars-d-learn wrote: > On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote: >> On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote: >> >>> On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote: On Wed, 11 Mar 2015 13:48:45 +00

Re: enum and static if

2015-03-11 Thread Artur Skawina via Digitalmars-d-learn
On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote: > On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote: > >> On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote: >>> On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote: >>> This code does not work: enum Test { >

Re: enum and static if

2015-03-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, March 11, 2015 14:55:01 Namespace via Digitalmars-d-learn wrote: > Thanks, I've hoped that 'static if' is a full replacement for #if Walter Bright has a rather dim view of #if and friends in C/C++ given how often he's seen them abused, which is why version and static if are more rest

Re: enum and static if

2015-03-11 Thread Namespace via Digitalmars-d-learn
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote: On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote: This code does not work: enum Test { Foo, static if (__VERSION__ >= 2067) Bar, } Quatz } Any chance that this could work? nope. `static if` is statement,

Re: enum and static if

2015-03-11 Thread ketmar via Digitalmars-d-learn
On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote: > On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote: >> On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote: >> >>> This code does not work: >>> >>> >>> enum Test { >>> Foo, >>> static if (__VERSION__ >= 2067) >>> Bar, >>>

Re: enum and static if

2015-03-11 Thread wobbles via Digitalmars-d-learn
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote: On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote: This code does not work: enum Test { Foo, static if (__VERSION__ >= 2067) Bar, } Quatz } Any chance that this could work? nope. `static if` is statement,

enum and static if

2015-03-11 Thread Namespace via Digitalmars-d-learn
This code does not work: enum Test { Foo, static if (__VERSION__ >= 2067) Bar, } Quatz } Any chance that this could work?