www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - traits getOverload of a template method

reply "QAston" <qaston gmail.com> writes:
How do i get aliases to overloads of a template method like

Class A
{
     int a(T)(T tq,T tw);
     int a(T)(T tq);
}
__traits(getOverloads, A, "a(int)")doesnt work
Feb 06 2014
parent ZombineDev <valid_email he.re> writes:
On Thursday, 6 February 2014 at 23:06:03 UTC, QAston wrote:
 How do i get aliases to overloads of a template method like

 Class A
 {
     int a(T)(T tq,T tw);
     int a(T)(T tq);
 }
 __traits(getOverloads, A, "a(int)")doesnt work
Bump. I also have a similar problem. I have a module with two function templates that are overloaded (they have the same name, but different sets of parameters) and I need to select one of them so I can cast it to a function with the nogc attribute, similar to this: http://p0nce.github.io/d-idioms/#Bypassing- nogc. ``` // move has two overloads: `T move(T)(ref T)` and `void move(T)(ref T, ref T)` // and I need to select the second one here: cast(FT)(move!int)(arg1, arg2) ``` Otherwise I get "Error: template std.algorithm.mutation.move matches more than one template declaration".
Jan 26