Boost logo

Boost Users :

From: Hugh Hoover (hugh_at_[hidden])
Date: 2006-05-20 12:06:52


I'm currently using 1_33_1

I've been having some problems with serialization so I built a test
module that serializes a set of class template instantiations in a
way that vaguely matches my real application. The template instances
are derived classes from a common pure virtual base class.
I got it to work properly in the test app, but then noticed I hadn't
done BOOST_IS_ABSTRACT or BOOST_CLASS_EXPORT for the template
instantiations like I had in my real classes.
When I add BOOST_IS_ABSTRACT for the derived template instantiations,
it compiles, but then crashes in save_pointer because bpos_ptr is
NULL. The initial failure is higher in the call stack at
boost::archive::detail::save_pointer_type<>::invoke
(oserializer.hpp), where it requests the bpos_ptr from register_type.

I realize NOW that it's probably performing as expected (except
there's no assert) since the derived class is NOT abstract. I had
run into problems (much) earlier where it appeared that I needed the
BOOST_IS_ABSTRACT on the derived classes and not the base class but
that may have been a side effect of other things I was doing wrong.
It had not appeared to be a problem using the superfluous
BOOST_IS_ABSTRACT until recently (switch to 1_33_1?).
I note that the boost cvs tip version (for 1_34) also does not have
an assert there. I'm not sure if that would have helped me figure
out what was wrong, but at least an assert would terminate things
closer to the source of the problem...

Anyway - perhaps this will help someone else who's running into the
NULL bpos_ptr problem...

Thanks for your great work and support on the forum here!

Hugh Hoover
Enumclaw Software.


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