AMDG On 04/10/2012 11:58 AM, Aaron_Wright@selinc.com wrote:
If I read that web page correctly, the only time raw pointers are used is when creating a backup for when a copy constructor fails. From the reading it would seem that the backup point is not persisted. When the copy constructor fails, the backup is copied off the heap into variant's storage.
No. In this case, the backup isn't copied because that could also throw, and then how could we preserve the invariants? If the copy constructor fails, Boost.Variant simply stores the pointer to the heap backup.
When the copy constructor doesn't fail, the backup is discarded. This raw pointer would only be needed for a small moment in one process. It would not need to be shared with another process. So variant should work fine with interprocess.
I'm making some assumptions here that that web page contains everything I need to know. Am I assuming too much?
In Christ, Steven Watanabe