Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!munnari!otc!mikem From: mikem@otc.OZ (Mike Mowbray) Newsgroups: comp.lang.c++ Subject: Re: Questions about C++ Message-ID: <129@otc.OZ> Date: Tue, 16-Jun-87 23:07:12 EDT Article-I.D.: otc.129 Posted: Tue Jun 16 23:07:12 1987 Date-Received: Sun, 21-Jun-87 09:23:09 EDT References: <964@vaxb.calgary.UUCP> Distribution: comp Organization: O.T.C. Systems Development, Australia Lines: 39 In article <964@vaxb.calgary.UUCP>, west@calgary.UUCP (Darrin West) says: >> > o Associated operators like 'in' and 'qua' [ see below ] aren't available >> >> These are not really needed. You achieve the same result in other ways. See >> below. > > I don't think you can make this blanket statement. There are a lot of > simulationists who would not like to live without it. :-) ? Earlier in my C++ "career", I wondered about this very thing, thinking it would be nice to know at run-time if an instance of class x was actually a class something_else. The thing that leads me to make the above "blanket statement" is that operators like in and qua are basically only needed is to enable you to *do* things based on what they return. I.e: the crucial thing (I believe) is to shift one's design focus from "what is xyz?" to "what do I want to do with xyz?" Then it becomes clear that virtual functions are perfect for the job. Someone else mentioned that it's not clear yet exactly what techniques are good techniques. "Run-time explicit type info" versus "virtual functions" are a classic case of this and I'm sure we haven't heard the last of it. By the way, if you haven't read Bjarne's paper on multiple-inheritance (delivered at EUUG in May I understand), get a copy somehow. It's fascinating. Not only can you have multiple base classes in the obvious sense, you can have virtual base classes (where the grandparent base part of two separate parent base classes is a single entity in the derived child class rather than two separate lots of grandparent). You can also derive (actually name-extend) from a pointer within the class or outside it (great for getting rid of all those dummy little member functions we all know and hate). I for one will be very interested to play with it if/when it becomes part of commercial C++. Mike Mowbray Systems Development Overseas Telecommunications Commission (Australia) UUCP: {seismo,mcvax}!otc.oz!mikem ACSnet: mikem@otc.oz