[serialization] reference to a vector of shared pointers of objects with non-default constructible templated class
Hello, I have a non-default templated class (let's call it Klass), serialized throw a pointer, so I redefined save_construct_data and load_construct_data for the type Klass<double>. One of the member of my class has the following type: typedef boost::shared_ptr< Point3d<T> >PointPtr; vector< PointPtr >& stuff; Point3d is another templated class. T could be for instance, double. Point3d is track_selectivly, Klass is track_selectivly and serialized by another class with a pointer. In save_construct_data when I do : ar << t->stuff; I've got the following problem : boost-1_33/boost/archive/detail/oserializer.hpp:566: error: incomplete type `boost::STATIC_ASSERTION_FAILURE<false>' does not have member `value' Perhaps I didn't place the good track attribute. Does someone have an idea ? Thanks in advance!
a) review the rationale regarding the saving non-const values. Try using ar & t->stuff and see if that works. b) consider whether you need to override save_construct at all.
From your description it shouldn't seem necessary to me. But its hard to know without more context.
Robert Ramey codeur@altern.org wrote:
Hello,
I have a non-default templated class (let's call it Klass), serialized throw a pointer, so I redefined save_construct_data and load_construct_data for the type Klass<double>. One of the member of my class has the following type:
typedef boost::shared_ptr< Point3d<T> >PointPtr; vector< PointPtr >& stuff;
Point3d is another templated class. T could be for instance, double. Point3d is track_selectivly, Klass is track_selectivly and serialized by another class with a pointer.
In save_construct_data when I do : ar << t->stuff;
I've got the following problem : boost-1_33/boost/archive/detail/oserializer.hpp:566: error: incomplete type `boost::STATIC_ASSERTION_FAILURE<false>' does not have member `value'
Perhaps I didn't place the good track attribute. Does someone have an idea ?
Thanks in advance!
participants (2)
-
codeur@altern.org
-
Robert Ramey