August 20, 2013 Re: Templated structs / variant values | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | Dicebot wrote: > 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. Yeah, that was a typical PEBKAC. I somehow assumed you use U, U... as dummy placeholders :) even that I know this syntax. Anyway, this works as expected, so thank you very much (and all the other that contributed). -- Marek Janukowicz |
Copyright © 1999-2021 by the D Language Foundation