On Monday, 20 April 2015 at 17:02:18 UTC, CodeSun wrote:
And where I can find the D symbol definition, because
information like ‘_D2tt2Ti12__T3getTAyaZ3getMFAyaZAya’ makes me
really confused.
---
import std.demangle;
auto friendlySymbol =
demangle("_D2tt2Ti12__T3getTAyaZ3getMFAyaZAya");
--
On Monday, 20 April 2015 at 17:02:18 UTC, CodeSun wrote:
I have test a snippet of code, and I encountered with a weird
link error.
The following is the demo:
import std.stdio;
interface Ti {
T get(T)(int num);
T get(T)(string str);
}
class Test : Ti {
T get(T)(int num
On Monday, 20 April 2015 at 17:02:18 UTC, CodeSun wrote:
So does it mean I can't declare function template inside
interface?
You can, but they are considered final so a body is required to
use them - they aren't just a pointer to the derived
implementation.
I have test a snippet of code, and I encountered with a weird
link error.
The following is the demo:
import std.stdio;
interface Ti {
T get(T)(int num);
T get(T)(string str);
}
class Test : Ti {
T get(T)(int num) {
writeln("ok");
}