Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pdn!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: asking an object for its type Message-ID: <27C6DBF3.28A3@tct.uucp> Date: 23 Feb 91 21:17:39 GMT References: <1991Feb19.000449.22255@gpu.utcs.utoronto.ca> <607@taumet.com> <1991Feb22.195826.14008@gpu.utcs.utoronto.ca> Organization: Teltronics/TCT, Sarasota, FL Lines: 20 According to craig@gpu.utcs.utoronto.ca (Craig Hubley): >Part of being a "pointer to Shape" is the ability to point to subclasses. >All virtual functions guarantee is to support the same interface, not >the same behavior. Clearly quite different things will happen when >different shapes are "stretched", for instance. If the "same" operation is actually several operations that are distinct in semantic terms (as opposed to implemention), then folding them together into one virtual function is a design error. Perhaps the theoretical "stretch()" function needs to be split up into several virtual functions. >... even Stroustrop and Koenig apparently acknowledge that something must >be done about it (I'm told they prefer the conditional-cast solution) I would appreciate some details on "the conditional-cast solution." -- Chip Salzenberg at Teltronics/TCT , "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)