Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!umich!dip.eecs.umich.edu!bagchi From: bagchi@dip.eecs.umich.edu (Ranjan Bagchi) Newsgroups: comp.lang.c++ Subject: family differences Keywords: derived classes, inheritance, navel lint A project that I'm working on has a main class (general) and some derived Message-ID: <1158@zip.eecs.umich.edu> Date: 26 Dec 89 06:46:49 GMT Sender: news@zippy.eecs.umich.edu Reply-To: bagchi@dip.eecs.umich.edu (Ranjan Bagchi) Organization: University of Michigan EECS Dept., Ann Arbor, MI Lines: 14 classes tell each other apart. i.e. in each class there's a function diff(general) which returns 0 with equality and nonzero without. Obviously, if spec1.diff is passed something of type spec2, the process should stop and pick something nonzero. I could get this thing solved easily with an identifier field but the idea of virtual functions (which I'm using) is to avoid them. Is there any way in C++ to have derived classes know whether it's dealing with another class of the same type? If this is a trivial question, then just e-mail me. -rj bagchi@sparky.eecs.umich.edu