www.digitalmars.com         C & C++   DMDScript  

D - [BUG?] Private function in templates

reply J Anderson <REMOVEanderson badmama.com.au> writes:
template privateTest(T)
{
    private void func()
    {
        
    }
    
}

alias privateTest!(int) p;

int main( char [] [] args )
{
    p.func(); //Shouldn't this cause a compile error?

    return 1;
}

Anderson
Jan 08 2004
parent reply "Walter" <newshound digitalmars.com> writes:
private, outside of a class, means private to the module, not private to the
template.

"J Anderson" <REMOVEanderson badmama.com.au> wrote in message
news:btknau$12a1$1 digitaldaemon.com...
 template privateTest(T)
 {
     private void func()
     {

     }

 }

 alias privateTest!(int) p;

 int main( char [] [] args )
 {
     p.func(); //Shouldn't this cause a compile error?

     return 1;
 }

 Anderson
May 19 2004
parent J Anderson <REMOVEanderson badmama.com.au> writes:
Walter wrote:

private, outside of a class, means private to the module, not private to the
template.

  
Dam you must be digging through some old messages. I know this now <g>. Not that I don't appreciated it. I guess it will help anyone else though.
"J Anderson" <REMOVEanderson badmama.com.au> wrote in message
news:btknau$12a1$1 digitaldaemon.com...
  

template privateTest(T)
{
    private void func()
    {

    }

}

alias privateTest!(int) p;

int main( char [] [] args )
{
    p.func(); //Shouldn't this cause a compile error?

    return 1;
}

Anderson

    
-- -Anderson: http://badmama.com.au/~anderson/
May 19 2004