private template members

Dmitry Olshansky dmitry.olsh at gmail.com
Sun May 1 06:15:58 PDT 2011


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;
> Test t = new Test;
> t.test(); /*ok*/
> t.testNonTemplate(); /*error*/
> writeln(t.getX()); /* prints 100 */
>
> I am using dmd 2.052
Then it's definitely a bug, it might be a duplicate report but it I 
suggest to file it anyway.
It sill fails on my almost newest DMD from github.

-- 
Dmitry Olshansky



More information about the Digitalmars-d-learn mailing list