Why do std.traits use template foo(args...) instead of foo(alias arg) ?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 18 08:33:09 PST 2014


On Thu, 18 Dec 2014 11:26:20 -0500
Steven Schveighoffer via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

> On 12/18/14 11:21 AM, ketmar via Digitalmars-d-learn wrote:
> > On Thu, 18 Dec 2014 15:52:06 +0000
> > Low Functioning via Digitalmars-d-learn
> > <digitalmars-d-learn at puremagic.com> wrote:
> >
> >> On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG wrote:
> >>> An exemple being fullyQualifiedName:
> >>> https://github.com/D-Programming-Language/phobos/blob/master/std/traits..d#L415
> >>>
> >>> I don't get this pattern. Is it documented somewhere ?
> >>
> >> http://dlang.org/variadic-function-templates.html
> > that's not a question about "what it does?", but the question about
> > "why it did this way?"
> >
> > the answer is simple: `alias` arguments can't accept types. i.e.
> 
> s/types/keywords
> 
> alias can accept types as long as they are symbols.
> 
> For instance:
> 
> struct S {}
> 
> pragma(msg, t1!S); // works.

yes, thank you. bad wording on my side.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141218/3c38cef1/attachment.sig>


More information about the Digitalmars-d-learn mailing list