On 05/01/2011 03:15 PM, Dmitry Olshansky wrote:
On 01.05.2011 16:38, hunt0r wrote:
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;
On 01.05.2011 16:38, hunt0r wrote:
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
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
Test;
t.test();
prints 100 instead of saying that the member test is not accessable.
Is it not possible to get private template members with D?
It's not clear if you are calling it from separate module or from the
same one. The access protection in D is module level, meaning you can
a
saying that the member test is not accessable.
Is it not possible to get private template members with D?