On Feb 14, 2013 11:55 PM, "Chris Herssens" <chris.h...@gmail.com> wrote:
>
> If I define a structure that contains a shared_ptr. Can I put this structure in a lockfree queue ?
>
No. Any struct with nontrivial member is also nontrivial. Here when I say nontrivial, I mean that it cannot simply be bitwise copied.
Brian
Brian
On 02/11/2013 04:04 PM, Scott Smedley wrote:
Hi all,
Is it possible to store std::shared_ptr objects in a boost::lockfree::queue?
eg. boost::lockfree::queue<std::shared_ptr<Message>> q;
Hi Scott -
Lockfree queues require that the queued type (T) meets the following requirements:
o T must have a copy constructor
o T must have a trivial assignment operator
o T must have a trivial destructor
shared_ptr has neither a trivial assignment operator or destructor and cannot be used in the lockfree containers.
michael