From: stephan b. <st...@s1...> - 2005-05-27 17:16:13
|
On Friday 27 May 2005 16:46, Prochnow, Christian wrote: > but when using type_info::name().. the type_info object returns the > mangled c++ ABI name of the type which _must_ be the same in all > compilation units. > > see this: http://gnu.open-mirror.com/software/gcc/faq.html#dso i wish the GCC guys would all read that. ;) i will swear on my life i've seen type_info::name() returns two different strings for the same type, depending on their creation scope. That was way back in 3.0/3.1, too, so maybe it doesn't happen anymore. In any case that page only applies to gcc. According to C++, what name() returns is UNDEFINED. Scott Meyers covers this in detail in one of his books. The way he puts it, even an implementation in which name() returns an empty string for every class is fully compliant with the standard. Not useful, but compliant. > i think we can make the second argument a const reference type. That still requires instantiating it, a limitation i haven't ever needed in a factory implementation. -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |