Assertion `__null != bpos' failed in /inclu de/boost/archive/detail/oserializer.hpp:436
ktomaszewski@zunit.com wrote:
I'm using Boost v. 1.44 on Linux and gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
I'm trying to serialize derived class object through base class shared-pointer. After reading tons of documentation from www.boost.org and checking all posible solutions (with macros) I turned to the simplest one which still doesn't work.
1) I register derived class with the archive by the code:
ar.register_type((PrefsMachineHash*)0); // PrefsMachineHash is a class derived from AHash class
2) I try to serialize boost::shared_ptr<AHash> object by the code:
ar & ptr; // ptr is of type: boost::shared_ptr<AHash>
After all, the assert (oserializer.hpp:436, assert(NULL != bpos)) triggers. The stack-trace is below. What is really weird is that on the small example everything works correctly. How is this possible? AFTER 7 HOURS I GAVE UP. ANY HELP, please?
you example uses : std::ostringstream os; Borg::SafeBinOutArchive ar(os); if rather than you use the following, what happens? std::ofstream os("filename", ios::binary);; boost::archive::binary_oarchive ar(os); Robert Ramey
participants (2)
-
ktomaszewski@zunit.com
-
Robert Ramey