Jeremie Pelletier wrote:
Another suggestion would be to have the ?: syntax supported for static 
statements, as we're currently forced to use static ifs. It really adds a lot 
of code to templates for even simple conditions.


?: already works at compile time, at least in D2. I use it all the time.

  template cat(string a, string b, bool addSpace)
  {
      enum string cat = a ~ (addSpace ? " " : "") ~ b;
  }

  static assert (cat!("foo", "bar", false) == "foobar");
  static assert (cat!("foo", "bar", true) == "foo bar");

Is that what you meant?

-Lars

Reply via email to