I was calling it from another module:
in file Test.d:
class Test
{
private:
int x;
void testNonTemplate()
{
}
template test()
{
void test() {x= 100;}
}
public:
int getX() {return x;}
}
In file main.d:
import Test;
Test t = new Test;
t.test(); /*ok*/
t.tes
hi,
It seems that template members of a class are always public.
having a class like:
class Test
{
private:
int x;
template test(T)
{
void test(T t) {x= 100;}
}
public:
int getX() {return x;}
}
and calling:
Test t = new Test;
t.test();
prints 100 instead of sayin