home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17863 < prev    next >
Encoding:
Text File  |  1992-12-12  |  1.8 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: static members in derived classes
  5. Message-ID: <1992Dec12.175244.17775@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <1g7c8fINNdhf@horus.ap.mchp.sni.de> <Bz20Gt.29x@cs.uiuc.edu> <1992Dec11.145205.29761@wam.umd.edu>
  8. Date: Sat, 12 Dec 1992 17:52:44 GMT
  9. Lines: 28
  10.  
  11. krc@wam.umd.edu (Kevin R. Coombes) writes:
  12.  
  13. >Can anyone explain why C++ has no equivalent? I've run into a number of
  14. >situations when they might have been useful. I usually get around the
  15. >problem by using a different static member for each derived class, and
  16. >accessing them through virtual functions. This achieves the same goal,
  17. >but since I have to carry this out manually, it is tedious and error-prone.
  18. >Having "virtual static" data members would allow this proces to be carried
  19. >out automatically by the compiler. I assume the reason this wasn't done is
  20. >that it would break something else, but I can't see what.
  21.  
  22. "Virtual static" has been proposed from time to time.  I don't know of
  23. any technical objections to it.  There are lots of good ideas for
  24. extensions to C++.  The question is always one of evaluating the costs
  25. and benefits of any proposed extension.
  26.  
  27. Bjarne Stroustrup published an article about proposing extensions to C++,
  28. appearing in the June 1992 issue of C++ Report, and in the June 1992
  29. (I think it was June) issue of ACM SIGPlan Notices.  It included an
  30. extensive discussion about why not all good ideas should be accepted.
  31. ("Remember the Vasa!")  I can't say whether virtual static falls in the
  32. category of "not quite good enough".
  33.  
  34. If you think virtual static should become part of C++, submit a complete
  35. analysis along the lines described in the above paper.
  36. -- 
  37.  
  38. Steve Clamage, TauMetric Corp, steve@taumet.com
  39.