Re: Determining if a class has a template function

2016-10-14 Thread Meta via Digitalmars-d-learn
On Friday, 14 October 2016 at 09:15:40 UTC, Marc Schütz wrote: On Wednesday, 12 October 2016 at 16:57:50 UTC, Meta wrote: There's also a *very* ugly hack you can do: //A template function's .stringof is of the format name>()() //so match on the number of brackets to determine whether it's a

Re: Determining if a class has a template function

2016-10-14 Thread Marc Schütz via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 16:57:50 UTC, Meta wrote: There's also a *very* ugly hack you can do: //A template function's .stringof is of the format name>()() //so match on the number of brackets to determine whether it's a template function or not enum isTemplateFunction =

Re: Determining if a class has a template function

2016-10-12 Thread Meta via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 16:57:50 UTC, Meta wrote: //A template function's .stringof is of the format name>()() //so match on the number of brackets to determine whether it's a template function or not enum isTemplateFunction = __traits(isTemplate, f) &&

Re: Determining if a class has a template function

2016-10-12 Thread Meta via Digitalmars-d-learn
On Wednesday, 12 October 2016 at 16:29:22 UTC, Basile B. wrote: On Tuesday, 11 October 2016 at 20:17:19 UTC, Straivers wrote: I have a class T with a templated function foo(string name)(int, int, float) that will be mixed in via template, and I want to determine if that class has mixed it in

Re: Determining if a class has a template function

2016-10-12 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 20:17:19 UTC, Straivers wrote: I have a class T with a templated function foo(string name)(int, int, float) that will be mixed in via template, and I want to determine if that class has mixed it in such that foo(name = "bar"). How could I go about this? Thanks.