Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: Question: Object transformations in C++ Message-ID: <6590176@hplsla.HP.COM> Date: 29 Jun 89 17:41:34 GMT References: <4413@druco.ATT.COM> Organization: HP Lake Stevens, WA Lines: 29 Regards trm's comments -- The example shows what I was thinking of in terms of using new, otherwise the same as my examples using "this." But, I think maybe he's wrong about this technique being safe -- at least it confused the hell out of my compiler producing: Constructing Base. Constructing Base. Constructing Derived. Called Base::f() Called Derived::f() Called Derived::f() -- which is surely wrong by any standards. I would expect b.f() to be ill-defined, compiler dependent, depending on whether a compiler chooses to evaluate this at compile time or run time. For this to work as trm says would seem to imply virtual functions *always* have to be evaluated at run time -- which would also prevent their ever being in-line substituted. I think this would be wrong -- making people who don't play hack games with objects pay a substantial performance penelty for people who do play hack games with objects! Can we have this language issue clarified, please?