[C++-sig] Re: Interest in luabind
David Abrahams
dave at boost-consulting.com
Mon Jun 23 15:57:11 CEST 2003
"Daniel Wallin" <dalwan01 at student.umu.se> writes:
>> Again I can only offer a second-hand view. IIUC, on some platforms
>> it is possible to compare type_info objects across dll boundaries as
>> if they are in the same static link unit. I.e. there is nothing
>> special. On some platforms this is not possible, and type_id::name
>> is used instead. There is only one platform where relying on
>> type_id::name caused a bit of a hick-up, namely IRIX/MIPSpro. See
>> the comment near the top of the flew_fwd.h file (link in my previous
>> message).
>
> Ok. I guess you could unmangle the names to a standardized format if
> there are problems with this?
No :(
Sadly, the problem is that typedefs don't always get fully-unwound in
type_info names, e.g.:
// Module 1, prints ``X<long>::type``
#include <iostream>
template <class T>
struct X
{
typedef int type;
};
int main()
{
std::cout << typeid(X<long>::type).name() << std::endl;
}
// Module 2, prints ``int``
#include <iostream>
int main()
{
std::cout << typeid(int).name() << std::endl;
}
There's no issue in different translation units within a module; the
linker just picks a generated name() string from one translation unit.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list