Re: [Cppunit-devel] config.h changes committed
Brought to you by:
blep
From: Steve M. R. <ste...@vi...> - 2001-06-18 17:20:51
|
On Mon, Jun 18, 2001 at 05:16:36PM +0200, Baptiste Lepilleur wrote: > Quoting "Steve M. Robbins" <ste...@vi...>: > > > On Mon, Jun 18, 2001 at 09:03:04AM +0200, Bastiaan Bakker wrote: > > I am suggesting to eliminate one symbol in favour of the other. > > If I have to choose, I would keep HAVE_RTTI because it has some > > precedence: it comes from the autoconf macro archive. But I can > > see reasons for preferring to keep USE_TYPEINFO. > OK. I did know what's was behind the RTTI thingy (kinda strange, I did not > though that you could have the type_info without dynamic_cast). All I'm saying is that the macro defines HAVE_RTTI based on the presence of typeid(). You are probably right that dynamic_cast is present if typeid() is present; I don't know much about RTTI. It may be that the reverse is not true, however. My instinct is to assume dynamic_cast is available, if needed, (and without checking) until someone tells us otherwise. > Well, I propose to keep USE_TYPEINFO. > > Our USE_TYPEINFO could be defined as: you have typeinfo, and the name() > methode return a human readable name (that last one can't be tested by a > machine unfortunately). So it's a stronger requirement than HAVE_RTTI. It's true that GCC can produce an ungainly type name like t23Triangle_3_Plane_3_test1ZQ24CGALt11Homogeneous2ZQ24CGAL4GmpzZQ24CGALt8Quotient1ZQ24CGAL4Gmpz.point_intersection so the idea of perhaps not using that name has merit. In that case, the symbol might be more appropriately-named USE_TYPEINFO_NAME. You may still wish to use type_info structures to test equality of types. I'll have to think about this. There seem to be relatively few uses of using type_info::name() at present, and I'm puzzled by some of them. For example, what is the purpose of class CppUnit::TypeInfoHelper? Is there some advantage to using a class rather than a simple function CppUnit::getClassName() ? -Steve -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |