"Gor F. Gyolchanyan" <gor.f.gyolchan...@gmail.com> wrote in message news:j5i2kv$2abh$1...@digitalmars.com... > Not exactly. > You'll also need to include code, which checks if the symbol API_VER is > defined > before checking it's value. This will make the code bloated. One way to do > it is > to define a template which takes the symbol in the form of a string, but > that > would look very ugly.
Why would you do that? You'll get an error if it's undefined, just like you would with #if in c/c++. If you wanted to use existance of a symbol instead of an enum's value, static if(is(typeof())) should do the job. Essentially, static if can already do what you're asking for, and is much more flexible.