On Wednesday, 19 March 2014 at 16:18:17 UTC, Andrej Mitrovic
wrote:
And after we determine it is a template, can we extract the
required arguments list like we can with a regular function at
all?
Well there's TemplateArgsOf for *instantiations*, but I'm not
sure how
one would do it with
As a workaround one can use set of relevant trait checks:
1) type is void
2) is not a variable or callable
3) .stringof fits NAME(ARGS) pattern
Wait just a bit more
https://github.com/D-Programming-Language/dmd/pull/3380 :)
On Wednesday, 19 March 2014 at 16:10:52 UTC, Dicebot wrote:
Wait just a bit more
https://github.com/D-Programming-Language/dmd/pull/3380 :)
megarox. Make it so.
Given:
template Foo(string T) { enum Foo = to!int(T); }
(or anything else, really)
Is there anything we can do with static if to identify it as a
template?
I tried:
static if(is(Foo == template)) {} // nope, basic type expected,
not template
Note that is(typeof(Foo) == function) {} is
On 3/19/14, Adam D. Ruppe destructiona...@gmail.com wrote:
Is there anything we can do with static if to identify it as a
template?
https://github.com/D-Programming-Language/dmd/pull/3380
And after we determine it is a template, can we extract the
required arguments list like we can with a
On 03/19/2014 05:34 PM, Adam D. Ruppe wrote:
On Wednesday, 19 March 2014 at 16:10:52 UTC, Dicebot wrote:
Wait just a bit more
https://github.com/D-Programming-Language/dmd/pull/3380 :)
megarox. Make it so.
Nice. I have some ugly hacks that's probably full of bugs for this (look
at the