🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: type/member tags (was Re: asking an object for its type)

#879
From: Chip Salzenberg
Date: Thu, 28 Feb 1991 14:37
19 lines
1459 bytes
According to peterson@choctaw.csc.ti.com (Bob Peterson):
>In article <27C95D3A.1715@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes:
>>Presumably, a well-designed class hierarchy will use a virtual
>>function to store objects ...
>
>Researchers and vendors have taken a number of implementation approaches
>...  The details of the various implementations vary widely, but few depend
>on virtual functions to supply type information.

Is there any reason to avoid virtual functions for object storage?

I had not envisioned a virtual function to return type information,
but rather a virtual function to actually _do_the_work_, so no one
outside of that function need know the actual type of the object
stored.
-- 
Chip Salzenberg at Teltronics/TCT      <chip@tct.uucp>, <uunet!pdn!tct!chip>
"It's not a security hole, it's a SECURITY ABYSS." -- Christoph Splittgerber
   (with reference to the upage bug in Interactive UNIX and Everex ESIX)
Technical Details
Message-ID: <27CD159D.6581@tct.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!pdn!tscs!tct!chip
References: <DSOUZA.91Feb24173454@optima.cad.mcc.com> <27C95D3A.1715@tct.uucp> <1991Feb27.154311.782@csc.ti.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!pdn!tscs!tct!chip
From: chip@tct.uucp (Chip Salzenberg)
Newsgroups: comp.std.c++
Subject: Re: type/member tags (was Re: asking an object for its type)
Message-ID: <27CD159D.6581@tct.uucp>
Date: 28 Feb 91 14:37:17 GMT
References: <DSOUZA.91Feb24173454@optima.cad.mcc.com> <27C95D3A.1715@tct.uucp> <1991Feb27.154311.782@csc.ti.com>
Organization: Teltronics/TCT, Sarasota, FL
Lines: 19