Serializing shared_ptr to const object

24 Oct
2007
24 Oct
'07
9:44 p.m.
Hi, Is there a way to serialize a shared_ptr to a const object? For example: ar & shared_ptr<const A> b; I receive a compile error that prevents the above code from working.

25 Oct
25 Oct
3:11 a.m.
If it's a pointer to an object, loading it would mean that one is changing a "const" A which violates what "const" is supposed to do. It is possible to do this but would require some casting in the appropriate place. Robert Ramey Eric Bourlier wrote:
Hi,
Is there a way to serialize a shared_ptr to a const object?
For example: ar & shared_ptr<const A> b;
I receive a compile error that prevents the above code from working. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
6453
Age (days ago)
6454
Last active (days ago)
1 comments
2 participants
participants (2)
-
Eric Bourlier
-
Robert Ramey