www.digitalmars.com         C & C++   DMDScript  

D - [experts] private typedef

reply Manfred Nowak <svv1999 hotmail.com> writes:
Currently this is possible:

class C{
  private typedef int myint;
}

and in another module:

import ...;
void main(){
  C.myint a;       // no error here
  C foo;
  //typeof(foo).myint b; // error .property not implemented for typeof
}

Obviously the private attribute is not followed.

Should types be attributed at all?
If not attributed, what are they: public or private?
Is it an error for `typeof' to not beeing able to yield the `myint' type?

So long.
Feb 19 2004
parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
"Manfred Nowak" <svv1999 hotmail.com> wrote in message
news:c12udg$149v$1 digitaldaemon.com...
 Currently this is possible:

 class C{
   private typedef int myint;
 }

 and in another module:

 import ...;
 void main(){
   C.myint a;       // no error here
   C foo;
   //typeof(foo).myint b; // error .property not implemented for typeof
 }

 Obviously the private attribute is not followed.

 Should types be attributed at all?

Yes.
 If not attributed, what are they: public or private?
 Is it an error for `typeof' to not beeing able to yield the `myint' type?

If it was public, yes.
Feb 19 2004