mat@mole-end.UUCP (Mark A Terribile) (05/14/89)
Would someone in the know tell me if pointer-to-member will be really healthy in 2.0 ? I've run into a family of bugs in 1.2.1 on the Sun and Glockenspiel's 1.1 for MS-DOS including Failure to insert the virtualization code in inline'd code that uses call by pointer-to-member-function. Failure to properly cast the pointer-to-function found in the vtbl (no inline expansion) when making the call when the vtbl case must be checked. Failure to properly write the dereference in the second case. The functions involved were output functions of the general form virtual ostream& X::put( ostream& ); and ostream& Y::put( ostream& ); where Y is derived from X. The inline that failed was written ostream& X_io::operator()( ostream& o ) { return X_pointer->*put_mem_p( o ); }; In the place where the compiler gave up, the inline was itself called out of an inline (a friend): ostream& operator<<( ostream& o, X_io& x ) { return x( o ); }; -- (This man's opinions are his own.) From mole-end Mark Terribile
ark@alice.UUCP (Andrew Koenig) (05/14/89)
In article <189@mole-end.UUCP>, mat@mole-end.UUCP (Mark A Terribile) writes: > Would someone in the know tell me if pointer-to-member will be really > healthy in 2.0 ? They will be much healthier than in 1.2; that part of the compiler has undergone a major overhaul. There's a paper in the 1988 Usenix C++ proceedings by Lippman and Stroustrup that describes, in part, the incredibly hairy stuff they had to do to get pointers to members right. It is mind-bogglingly difficult. -- --Andrew Koenig ark@europa.att.com