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