Re: How do I the temlate parameter name as string?

2018-11-27 Thread bauss via Digitalmars-d-learn
On Tuesday, 27 November 2018 at 02:00:44 UTC, PacMan wrote: ParameterIdentifierTuple from std.traits did work fine for regular functions but not for template functions: Error: template instance `std.traits.ParameterIdentifierTuple!(f)` does not match template declaration

Re: How do I the temlate parameter name as string?

2018-11-26 Thread Neia Neutuladh via Digitalmars-d-learn
On Tue, 27 Nov 2018 02:00:44 +, PacMan wrote: > f is defined as: > >> void f(T)(T t, string p) >> if(is(T == A) || is(T == B)) >>{ >> // ... >>} > > my goal is get "p" as string. `f` is a template that generates functions. Before you instantiate that template, the function doesn't

Re: How do I the temlate parameter name as string?

2018-11-26 Thread Soulsbane via Digitalmars-d-learn
On Tuesday, 27 November 2018 at 02:00:44 UTC, PacMan wrote: ParameterIdentifierTuple from std.traits did work fine for regular functions but not for template functions: Error: template instance `std.traits.ParameterIdentifierTuple!(f)` does not match template declaration

How do I the temlate parameter name as string?

2018-11-26 Thread PacMan via Digitalmars-d-learn
ParameterIdentifierTuple from std.traits did work fine for regular functions but not for template functions: Error: template instance `std.traits.ParameterIdentifierTuple!(f)` does not match template declaration `ParameterIdentifierTuple(func...) if (func.length == 1 && isCallable!func)`