Tuples and variable-length template parameter lists
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Tue Nov 6 10:31:33 PST 2012
On 11/05/2012 06:14 PM, Simen Kjaeraas wrote:
> std.typecons.Tuple does a bit of magic behind the scenes. This includes
> ridding itself of non-type parameters.
>
> Simply put, you can imagine inserting the type tuple directly into the
> function definition:
>
> void add(ID id, size_t arg0, real arg1, "value" arg2);
>
> as you probably notice, the last argument looks weird.
>
> Now, Phobos does not currently have a staticFilter template, nor does it
> have an isType template, so here are implementations of those:
>
> add would then have this signature:
>
> void add(ID id, staticFilter!(isType, Properties));
Oh, very cool! Thanks ever so much for that. Incidentally, and I don't
understand why, using isTypeTuple also seems to work ...
Is there a case for some patches adding those features to Phobos?
More information about the Digitalmars-d-learn
mailing list