On Wed, 11 Feb 2009 00:28:21 +1300, bobef <bo...@nospam-abv.bg> wrote:

I was thinking... what is the point of version() ? It is so inflexible. There is no even version(!...). Why not "static if(version(DMD))" or static if(is(version == DMD))?

Regards,
bobef

You could try something like this:


module Vers;

template vers(char[] V)
{
      mixin("version(" ~ V ~ ")
      {
            const bool vers = true;
      }
      else
      {
            const bool vers = false;
      }");
}

int main()
{
      static if(vers!("X86_64"))
      {
            long a;
            pragma(msg, "64 bit");
      }
      else
      {
            int a;
            pragma(msg, "32 bit");
      }

      a = 2;

      return a;
}

Reply via email to