Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: Bug in 2.0 with Pass by Reference? Keywords: bug, cfront 2.0, pass by reference Message-ID: <10314@alice.UUCP> Date: 7 Jan 90 22:02:42 GMT References: <4577@helios.ee.lbl.gov> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 22 In article <4577@helios.ee.lbl.gov>, stan@csam.lbl.gov (See-Mong Tan) writes: > int FSI::pathOpen( char *, StoredObject * &, Class *); > ObjectDictionary * od = 0; > int status = pathOpen( dirname, od, ObjectDictionaryClass ); So od is an ObjectDictionary* and FSI::pathOpen takes a second argument that is a reference to a StoredObject*. The two pointer types StoredObject* and ObjectDictionary* are different types. It is not possible to bind a StoredObject*& to an ObjectDictionary* object. This is true even if ObjectDictionary is derived from StoredObject -- just because you can bind a StoredObject& to an ObjectDictionary, that doesn't mean you can bind a StoredObject*& to an ObjectDictionary*. One way to see this more clearly is to realize that converting from ObjectDictionary* to StoredObject* might involve a change in internal representation in the presence of multiple inheritance. -- --Andrew Koenig ark@europa.att.com