Hmmm. I was almost thinking the same thing,
but I was hoping there was something I was missing.
What about boost::variant? Can I stuff
that into a queue in shared memory?
---
Aaron Wright
From:
Ion Gaztañaga <igaztanaga@gmail.com>
To:
Boost User List <boost-users@lists.boost.org>
Date:
04/03/2012 02:30 PM
Subject:
Re: [Boost-users]
[Interprocess] Collection of base shared_ptr
Sent by:
boost-users-bounces@lists.boost.org
El 03/04/2012 21:18, Aaron_Wright@selinc.com escribió:
> I'm using Boost 1.49, and Visual Studio 10.
>
> I'm having a hard time figuring out how to store a shared_ptr to a
> derived class in a collection of shared_ptr to the base class. This
> is something I do all the time with normal shared pointers. This is
> my code:
You can't do that. In shared memory there is no place for virtuality (so
no room for virtual destructors essential to be able to use derived
classes). boost::interproces::shared_ptr is only for reference counted
semantics.
Best,
Ion
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users