Thread View: comp.std.c++
1 messages
1 total messages
Started by MARTIN LANG
Mon, 05 Oct 1992 12:52
static members and access control?
Author: MARTIN LANG
Date: Mon, 05 Oct 1992 12:52
Date: Mon, 05 Oct 1992 12:52
31 lines
1283 bytes
1283 bytes
Follwing a short class declaration with a private static field of an
enumaration type. The enumaration is also declared private. The question
now is: is the initialization illegal or not.
I have tried it with two different compilers. Cfront compiles without
error, Zortech complains because the enumaration is private. The ARM is
not quite clear at this point. In chapter 11 page 239 it states:
private: that is, its name can be used only by member functions and
friends of the class in which it is declared.
In my opinion a static member is neither a member function nor a friends.
Does this mean that Cfront is wrong?
class Test
{
private:
enum E1 { a,b};
static E1 e;
};
E1 Test::e=Test::a;
Thanks,
Martin Lang
University of Stuttgart
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads