🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #908

Re: template base classes

#908
From: Tom Horsley
Date: Tue, 05 Mar 1991 16:00
25 lines
2036 bytes
>NormalLamp and MagicalLamp have a way to store some class specific information
>that is local to that class, but is only defined in the base class.
>THERE WAS NO NEED FOR THE PROGRAMMER OF THE DERIVED CLASSES TO KNOW HOW
>THIS INFORMATION IS STORED AND THERE WAS NO 'EXTRA WORK'.

>Using traditional C++ programming facilities the programmer would have been
>forced to write the static members in the derived classes by hand.

I have not been following the c++ standard very closely, but I had always
assumed this sort of thing would be possible with templates. (For a more
useful example than nethack, you might want to look at the convolutions the
NIH library has to go through with macros used to define classes).

If this is really not possible with the current template proposals, I am
all in favor of adding something to allow it. I have often wanted some way
to automatically derive new static members for classes (consider the use
for something like a cache for class specific information).
--
======================================================================
domain: tahorsley@csd.harris.com       USMail: Tom Horsley
  uucp: ...!uunet!hcx1!tahorsley               511 Kingbird Circle
                                               Delray Beach, FL  33444
+==== Censorship is the only form of Obscenity ======================+
|     (Wait, I forgot government tobacco subsidies...)               |
+====================================================================+
Technical Details
Message-ID: <TOM.91Mar5110006@rcx1.ssd.csd.harris.com>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!uflorida!travis!tom
References: <AHUTTUNE.91Mar5141930@bulldozer.hut.fi>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!uflorida!travis!tom
From: tom@ssd.csd.harris.com (Tom Horsley)
Newsgroups: comp.std.c++
Subject: Re: template base classes
Message-ID: <TOM.91Mar5110006@rcx1.ssd.csd.harris.com>
Date: 5 Mar 91 16:00:06 GMT
References: <AHUTTUNE.91Mar5141930@bulldozer.hut.fi>
Sender: news@travis.csd.harris.com
Distribution: comp
Organization: Harris Computer Systems Division
Lines: 25
In-reply-to: ahuttune@niksula.hut.fi's message of 5 Mar 91 13:19:30 GMT