On Saturday, 22 April 2017 at 12:43:41 UTC, Andrey wrote:
On Saturday, 22 April 2017 at 12:23:32 UTC, Basile B. wrote:
On Saturday, 22 April 2017 at 11:45:54 UTC, Andrey wrote:
use a "template this" parameter:
void onCreate(this T)()
{
writeln(getSymbolsByUDA!(T, OnClickListener).stringof);
}
if possible. The problem is not solved if onCreate is not
called on the most derived.
It works if I explicitly specify the type:
MyView v2 = new MyView();
v2.onCreate(); // Works well, using MyView type
void test(View v) {
v.onCreate(); // using View type :(
}
But this working well:
this(this T)() {
writeln(T.stringof);
}
It suits me, thanks a lot!