Mail Archives: djgpp/1997/09/05/02:17:26
Erik Max Francis (max AT alcyone DOT com) writes:
> Paul Derbyshire wrote:
>
>> How do the enum elements BINARY and so forth become members of ios, as
>> in
>> ios::, and not of some enum? Normally the :: thing only applies to
>> member
>> functions and instance variables, not to enums. Is the enum actually
>> inside the class? Can a class contain structs and subclasses actually
>> inside itself so they are only defined in the scope of the class, for
>> naming purposes?
>
> Yes. In C++ if you have full scoping, so lexical elements can be
> defined inside classes:
>
> class C
> {
> public:
> struct S { int i; };
>
> enum E { e1, e2 };
> };
>
> Inside the scope of the class, you can refer to these things as S and E,
> but outside you must refer to them as C::S and C::E (and the enum names
> as E::e1 and E::e2).
And this is what ios::binary is?
class ios {
enum suchlike {binary,output,...}
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -