On 3/5/18 9:03 AM, Jorge Lodos via Boost wrote:
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.
This as an excellent and useful observation. I extra efforts to be sure that the serialization library worked without RTTI being enabled. In then end I couldn't make it work. So definitely make a PR or ticket for this. You might want to include an update in the documentation in the PR. Also, since you're put your finger on the issue, maybe there is a tweak that could be made so that serialization of polymorphic types might be supported as well. Robert Ramey
Jorge
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost