
On Fri, Nov 6, 2009 at 12:36 PM, Robert Ramey
Noah Roberts wrote:
In article
, emildotchevski@gmail.com says... On Thu, Nov 5, 2009 at 4:08 PM, Noah Roberts
wrote: Consider something like so:
struct A { ...? };
struct B { std::list<A> items; };
struct C { A const* ptr_to_item_in_B_items; };
All this happens without the programmer/user needing to do anything special other than make sure that the types are not "untracked". In almost all cases, the defaults will give the behavior desired without the programmer/user even being aware of it.
Interesting. Then why won't it work with A const *? If I understand correctly, there are two possibilities for serializing a A const * pointer: 1) This address has been "seen" before. In this case, you don't serialize the pointee, and whether or not it is const is irrelevant. 2) The address hasn't been "seen" before, so you new an object of type A, serialize that, then set the (const) pointer being serialized to A. Either way, why does it matter if we're dealing with a pointer-to-const? Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode