www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - versioning in struct initialization

reply Paul Runde <prunde consolidated.net> writes:
Any chance that this will be allowed in the future?

struct foo
{
    int x;
    int y;
    version(Windows) int z;
}


foo xyz = { 1,
             2,
             version(Windows) 3 // error
};

Paul
May 21 2004
parent "Walter" <newshound digitalmars.com> writes:
No, but you can do this:

struct foo
{
    int x;
    int y;
    version(Windows) int z = 3;
}


"Paul Runde" <prunde consolidated.net> wrote in message
news:c8m6hb$1nej$1 digitaldaemon.com...
 Any chance that this will be allowed in the future?

 struct foo
 {
     int x;
     int y;
     version(Windows) int z;
 }


 foo xyz = { 1,
              2,
              version(Windows) 3 // error
 };

 Paul

May 21 2004