2009/6/15 Kevin Regan:
> Thanks again Jonathan. I'm happy as long as the type_info object doesn't go out of
> scope when the object is deleted.
yep, that's fine.
> By the way, can you point me to where this is covered in the C++ spec? I'm not an
> expert, but I do like to fill in my knowledge gaps whenever I get the chance. :-)
5.2.8 [expr.typeid] paragraph 1 covers the lifetime. The standard
doesn't have anything to say about shared libraries, but it doesn't
specifically say that type_info objects returned by typeid must be
unique. In the GCC implementation on GNU/Linux you can get distinct
objects with the same value by using typeid in shared libraries.