home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: static data members of private types impossible?
- Message-ID: <1992Nov13.183031.10946@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Nov12.151014.10610@debbie>
- Date: Fri, 13 Nov 1992 18:30:31 GMT
- Lines: 23
-
- johnh@tt.com (John Hasselkus) writes:
-
- |How do you define a static data member of a private type? For example:
-
- |class A {
- | private:
- | enum FOO {
- | FOO_1,
- | FOO_2
- | };
- | static FOO foo;
- |};
-
- |A::FOO A::foo; // <- Compiler won't let you use private types out here
-
-
- You can't have a static member of a private type. Some compilers
- allow it, but the ARM is clear that it is illegal. You can have a
- private static member, but its type must accessible at file scope.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-