1
module a;
void foo(T)(){
import std.stdio;
writeln(T.stringof);
}
module b;
import a;
private alias foo = a.foo;
void foo(T: int)(){
import std.stdio;
writeln("Special int");
}
//app.d
void main()
{
import a;
import b;
foo!int();
}
이것은 Special Int
대신 int
을 인쇄합니다. 다른 모듈에서 템플릿을 전문화 할 수 있습니까?다른 모듈에서 템플릿을 어떻게 전문화합니까?
오늘 D template specialization in different source file에 대한 대답은 아직 관련이 있다고 생각합니까?