Boost logo

Boost :

Subject: [boost] [serialization] RTTI issue with non-polymorphic types
From: Jorge Lodos (jlodos_at_[hidden])
Date: 2018-03-05 17:03:17


Hi
I am trying to use the serialization library for non-polymorphic types
without RTTI. In release mode everything works fine, but in debug mode there
are problems because dynamic_cast is used for debugging purposes.
The code is in smart_cast.hpp, starting in line 87:

                #if ! defined(NDEBUG) \
                || defined(__MWERKS__)
                    // do a checked dynamic cast
                    return cross::cast(u);
                #else

I believe the first line could be replaced with:

                #if (! defined(NDEBUG) && ! defined(BOOST_NO_RTTI) ) \

Is this something you are willing to consider? I decided to ask before
creating any ticket or pull request because there is a number of previous
attempts to make serialization work without RTTI for the general case.
But this is specific for non-polymorphic types.
Thanks.

Jorge


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk