Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] Collection of base shared_ptr
From: Aaron_Wright_at_[hidden]
Date: 2012-04-03 17:37:03


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_at_[hidden]>
To:     Boost User List <boost-users_at_[hidden]>
Date:   04/03/2012 02:30 PM
Subject:        Re: [Boost-users] [Interprocess] Collection of base 
shared_ptr
Sent by:        boost-users-bounces_at_[hidden]
El 03/04/2012 21:18, Aaron_Wright_at_[hidden] 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_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net