That is exactly what I am trying to avoid because this would force me to reinvent all the nice features that are already implemented in the library (to store pointers only once, to automatically store the right type). Regards, Roland On Thursday 06 August 2009 19:25:42 Matthias Troyer wrote:
I see your point. Here is one thing you could do: you could wrap your pointer in a special class and have the serialize function of that class do the allocation, loading of the object, and registration of the pointer for you. Would that work?
Matthias
On 4 Aug 2009, at 03:04, Roland Kaminski wrote:
I do not see how these could be used for this case. load_construct_data provides a pre-allocated pointer that can then be initialized. And after save_construct_data is called the pointer is already registered but without the additional size information. Do I miss something?
Regards, Roland
On Tuesday 04 August 2009 02:38:01 Matthias Troyer wrote:
On 3 Aug 2009, at 15:34, Roland Kaminski wrote:
The code is full of such "dangerous" optimizations but most of them can be somehow handled. It is optimized to be as cache-friendly as possible that is why I would like to not remove this one. A hook during deserialization would be exactly what I need. I could also imagine other worarounds but all of them are very ugly.
Look at this part of the documentation:
http://www.boost.org/doc/libs/1_39_0/libs/serialization/doc/serializatio n.h tml#constructors
and overload load_construct_data and save_construct_data for your type
Matthias
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users