Path: utzoo!news-server.csri.toronto.edu!torsqnt!geac!alias!news From: rae@utcs.toronto.edu (Reid Ellis) Newsgroups: comp.lang.c++ Subject: Re: asking an object for its type Message-ID: <1991Mar15.062404.13226@alias.uucp> Date: 15 Mar 91 06:24:04 GMT References: <1991Feb20.232710.7843@ithaca.uucp> <1485@acf5.NYU.EDU> <71037@microsoft.UUCP> <27D57565.2B22@tct.uucp> <1991Mar8.073356.25207@gpu.utcs.utoronto.ca> Sender: Reid Ellis Reply-To: Reid Ellis Organization: Alias Research, Inc. Toronto ON Canada Lines: 26 Craig Hubley writes: >We might want to listen to [people who are already using other OO >languages and building reusable code libraries] tell us what they >need. Especially if the only answer on "how to do it" coming from >the C++ community is "add it as a virtual in the base class". I >agree with the author who called this "laughable". From the >perspective of binary-reusable libraries, anyway. Why is this "laughable"? This seems to be the crux of the whole thing. Could you expand on this? What's wrong with a class otherType; struct foo { virtual otherType *asOther(); } approach, where "otherType" is a type not defined by the vendor of the [binary-only] class? This allows users to hook their own types in perfectly well. Or doesn't this address the needs you mention? Reid -- Reid Ellis 176 Brookbanks Drive, Toronto ON, M3A 2T5 Canada rae@utcs.toronto.edu || rae%alias@csri.toronto.edu CDA0610@applelink.apple.com || +1 416 446 1644