How do I the temlate parameter name as string?

bauss jj_1337 at live.dk
Tue Nov 27 18:02:36 UTC 2018


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 `ParameterIdentifierTuple(func...) if 
>> (func.length == 1 && isCallable!func)` (foo)
>
> 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.

p.stringof


More information about the Digitalmars-d-learn mailing list