On Tuesday, 25 June 2013 at 21:31:15 UTC, Walter Bright wrote:
http://wiki.dlang.org/DIP42

Reading through this thread, I already foresee a messy specification coming along for this. Instead, I'd propose something different that would keep the rules consistent yet have many more applications:

template(...) declaration = ... ;

So what you would have instead:

template(T) enum E = ... ;
template(T) alias A = ... ;

There's also the possibility for simple template constraints as well:

template(T) if(...) enum E = ... ;

Anything more complicated, such as static if, is probably best left to the classic style:

template E(T)
{
        static if(...) enum E = ... ;
        else enum E = ... ;
}

Reply via email to