Just a thought...

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Tue Apr 17 09:08:02 PDT 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 at 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.


More information about the Digitalmars-d mailing list