Templated structs / variant values

Dicebot public at dicebot.lv
Tue Aug 20 04:25:47 PDT 2013


On Tuesday, 20 August 2013 at 11:22:35 UTC, Marek Janukowicz 
wrote:
>> if(is(type == Setting!U, U...))
>
> This is not enough for me - I have many instantiations of 
> Setting struct
> template and I need all of them, regardless of parameters they 
> were
> instantiated with.

Have you actually tried this snippet? It does exactly that. 
"U..." is a pattern for variadic template argument list. 
Constraint will match Setting instance with any number of any 
template arguments.


More information about the Digitalmars-d-learn mailing list