Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!news!nujoizey!gwu From: gwu@nujoizey.tcs.com (George Wu) Newsgroups: comp.lang.c++ Subject: Re: Implementing inheritance Keywords: C++ inheritance implementation description Message-ID: <1885@news.tcs.com> Date: 16 Mar 91 01:16:10 GMT References: <1991Mar14.233914.14777@evax.arl.utexas.edu> Sender: root@tcs.com Reply-To: gwu@nujoizey.tcs.com (George Wu) Distribution: all Organization: Teknekron Communications Systems Lines: 22 Cc: measures@evax.uta.edu - I expect any good C++ book would contain a description of how C++ compilers implement inheritance. Certainly, Stanley Lippman's "C++ Primer" does so. In a sentence, a derived class is implemented as a structure containing both derived and inherited data elements. Accessing elements defined in different parts of the inheritance tree is mostly a matter of offsetting properly into the data structure. There are, of course, lots of other details, such as virtual functions and virtual inheritance. For the most part, add a level of dereference to implement them. Of course, most C++ books will not contain details specific to your compiler. If you really want that kind of information, I think you will need to start reading the source code. George ---- George J Wu, Software Engineer | gwu@tcs.com or uunet!tcs!gwu Teknekron Communications Systems, Inc.| (415) 649-3752 2121 Allston Way, Berkeley, CA, 94704 | Quit reading news. Get back to work.