
David Abrahams escribió:
on Wed Nov 12 2008, joaquin-AT-tid.es wrote:
I think something to this effect can be implemented resorting to <drumroll>helper support</drumroll>. Non-tested pseudocode follows. The idea is not to supress tracking (which can't be done) but rather to move stack-based objects to a safe location so that Boost.Serialization does not get confused by objects with potentially the same stack address.
[...]
template<class Archive> void load(Archive & ar,const unsigned int) { helper::table_type& table=ar.get_helper<helper>().table; T t; ar>>t;
^^^^^
Not that I really need this feature, but what is going to prevent the library from doing the usual thing it does when deserializing T here?
The call to reset_object_address than ensues: as every different object of non_tracking<T> gets reassigned to a unique element in the helper table, it's impossible that Boost.Serialization tracking capabilities mistakenly take one object t1 as the same as a previous t2 just because their (stack-based) addresses coincide. This is not supressing tracking, but effectively implies that it'll never impact the serialized stuff. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo