Thread overview
Just a thought...
Apr 17, 2012
F i L
Apr 17, 2012
Gor Gyolchanyan
Apr 17, 2012
F i L
April 17, 2012
Was just looking through some code and realized there's a lot of this:

  template isSomething(T) {
    enum isSomething = is( ... );
  }

I remember a discussion a little while ago about an alternative alias syntax:

  alias <name> = <type>;

Which I hope is still in the works, but I thought something similar _might_ be helpful for templates too. So the template above could be written:

  template isSomething(T) = is( ... );

Which looks a bit cleaner.


Just a thought.
April 17, 2012
What about:

enum isSomething(T) = is(...);

which would be referred to like this:

enum isIndeed = isSomething!T;

or

enum isSomething(T)
{
    foo = is(...),
    bar = is(...),
    hat = is(...)
}

which would be referred to as:

enum isIndeed = isSomething!(T).foo;

This would be the logical continuation of the numerous existing template shortcuts.

On Tue, Apr 17, 2012 at 7:41 PM, F i L <witte2008@gmail.com> wrote:
> Was just looking through some code and realized there's a lot of this:
>
>  template isSomething(T) {
>    enum isSomething = is( ... );
>  }
>
> I remember a discussion a little while ago about an alternative alias syntax:
>
>  alias <name> = <type>;
>
> Which I hope is still in the works, but I thought something similar _might_ be helpful for templates too. So the template above could be written:
>
>  template isSomething(T) = is( ... );
>
> Which looks a bit cleaner.
>
>
> Just a thought.



-- 
Bye,
Gor Gyolchanyan.
April 17, 2012
> enum isSomething(T) = is(...);

Yes, I like this better.