How to create TypeTuple/ExpressionTuple from tuple/tuples

Philippe Sigaud philippe.sigaud at gmail.com
Tue Aug 7 22:01:36 PDT 2012


On Tue, Aug 7, 2012 at 11:31 PM, Andrej Mitrovic
<andrej.mitrovich at gmail.com> wrote:
> On 8/7/12, Philippe Sigaud <philippe.sigaud at gmail.com> wrote:
>> You can also take the 'dual' of your solution and have a template that
>> makes a function automatically expand tuples
>
> But that doesn't work for variadic templates, which is the OP's case:
>
> int foo(T...)(T t) { return 1; }
> alias expander!foo efoo;  // error

The template can easily be modified to deal with template functions,
but in that case, you lose the parameter-type verification, for
example if the function template has a constraint.


More information about the Digitalmars-d-learn mailing list