22 May 19:28
Re: [serialization] Handling of references into a std::map
From: Sohail Somani <sohail <at> taggedtype.net>
Subject: Re: [serialization] Handling of references into a std::map
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-22 17:28:34 GMT
Subject: Re: [serialization] Handling of references into a std::map
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-05-22 17:28:34 GMT
Robert Ramey wrote: > This can't work. > > load a pointer creates a new pointer with a copy of the original object. > > adding the following to your test should make this clear > > ... > std::cout << "ref: " << *m.ref << std::endl; > ... > std::cout << "ref: " << *m2.ref << std::endl; > Ok, the author will know more than I! For the OP, you can have a map of pointers which will work. -- -- Sohail Somani http://uint32t.blogspot.com
RSS Feed