Re: private template members

2011-05-01 Thread Mike Wey
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;

Re: private template members

2011-05-01 Thread Dmitry Olshansky
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

Re: private template members

2011-05-01 Thread hunt0r
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

Re: private template members

2011-05-01 Thread Dmitry Olshansky
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

private template members

2011-05-01 Thread hunt0r
saying that the member test is not accessable. Is it not possible to get private template members with D?