Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] assert in void_caster
From: Emil Dotchevski (emil_at_[hidden])
Date: 2010-06-29 13:56:48


On Tue, Jun 29, 2010 at 10:13 AM, Robert Ramey <ramey_at_[hidden]> wrote:
>> As far as I understand the assert fires because the base derived
>> relationship is registered multiple times. But is this really a
>> problem? We placed the void_cast_register call in a macro that exists
>> in the implementation of every class anyway to be sure the base
>> derived relationship was registered. Now we have to solve this
>> differently because otherwise classes that have a serialize function
>> (most don't) will trigger the assert at startup. Is it save to
>> uncomment the assert? Are there real world scenarios when this assert
>> is helpful?
>
> In this scenario - code with the same signature exists in different DLLS.
> But there's no
> way to guarentee that it is in fact the same code!!!.  If one mixed
> different
> versions of the DLLs, one could easiliy have an error which is
> likely impossible to find.

On Windows, the standard library goes to great lengths to make
std::type_info objects that identify the same type from different DLLs
compare equal. This could lead to problems in case the DLLs have
different version of the type, but it doesn't mean that the use is
invalid when all DLLs have identical copies of the type.

I think the same logic applies to void_cast_register: when multiple
registrations for the same type from different DLLs occur, it should
assume that the types are identical.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net