Thread overview
private ??
Mar 29, 2004
eriser
Mar 29, 2004
eriser
Mar 29, 2004
e
Mar 29, 2004
J Anderson
Mar 29, 2004
Andy Friesen
March 29, 2004
class	pouet
{
private:

this()
{
a = 3;
}

void	test()
{
printf("private !!!");
}

int	a;
}

void main()
{
pouet p = new pouet();
p.test();

printf("%d", p.a);
}


March 29, 2004
return:

C:\bin\code\D\dmd\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi;

D:\eriser\D>test.exe
private !!!3


March 29, 2004
result !

D:\eriser\D>dmd test.d
C:\bin\code\D\dmd\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi;

D:\eriser\D>test.exe
private !!!3


March 29, 2004
eriser wrote:

//Module 1

>class	pouet
>{
>private:
>
>this()
>{
>a = 3;
>}
>
>void	test()
>{
>printf("private !!!");
>}
>
>int	a;
>}
>  
>

//Module 2

>void main()
>{
>pouet p = new pouet();
>p.test(); //Will be in error
>
>printf("%d", p.a); //Will be in error
>}
>
Visibility rules are on the modular level in D, if that was your question.

-- 
-Anderson: http://badmama.com.au/~anderson/
March 29, 2004
eriser wrote:
> class	pouet
> {
> private:
> 
> this()
> {
> a = 3;
> }
> 
> void	test()
> {
> printf("private !!!");
> }
> 
> int	a;
> }
> 
> void main()
> {
> pouet p = new pouet();
> p.test();
> 
> printf("%d", p.a);
> }

It's because everything is in the same module.  D treats them as friends. (to use the C++ term)

 -- andy