home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16225 < prev    next >
Encoding:
Text File  |  1992-11-14  |  912 b   |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: static data members of private types impossible?
  5. Message-ID: <1992Nov13.183031.10946@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <1992Nov12.151014.10610@debbie>
  8. Date: Fri, 13 Nov 1992 18:30:31 GMT
  9. Lines: 23
  10.  
  11. johnh@tt.com (John Hasselkus) writes:
  12.  
  13. |How do you define a static data member of a private type?  For example:
  14.  
  15. |class A {
  16. |  private:
  17. |    enum FOO {
  18. |      FOO_1,
  19. |      FOO_2
  20. |    };
  21. |    static FOO foo;
  22. |};
  23.  
  24. |A::FOO A::foo;    // <- Compiler won't let you use private types out here
  25.  
  26.  
  27. You can't have a static member of a private type.  Some compilers
  28. allow it, but the ARM is clear that it is illegal.  You can have a
  29. private static member, but its type must accessible at file scope.
  30. -- 
  31.  
  32. Steve Clamage, TauMetric Corp, steve@taumet.com
  33. Vice Chair, ANSI C++ Committee, X3J16
  34.