[comp.lang.c++] family differences

bagchi@dip.eecs.umich.edu (Ranjan Bagchi) (12/26/89)

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

bagchi@dip.eecs.umich.edu (Ranjan Bagchi) (12/26/89)

	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: 13

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