Boost sync_queue clear

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost sync_queue clear

Boost - Users mailing list
Hi,
I am a user of the Boost Thread library experimental class, "sync_queue".

I would like to know if there is a way to remove all elements currently in the queue.

I don't see a "clear()" or "erase()" type method exposed and I don't see an easy way to access the internal container as a workaround.

Thanks to all Boost developers for creating such a great collection of libraries.

Ken


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost sync_queue clear

Boost - Users mailing list


On Sat, Jan 20, 2018 at 12:17 AM, kjw via Boost-users <[hidden email]> wrote:
I am a user of the Boost Thread library experimental class, "sync_queue".

I would like to know if there is a way to remove all elements currently in the queue.

I don't see a "clear()" or "erase()" type method exposed and I don't see an easy way to access the internal container as a workaround.


I think the close() operation is the closest thing to what you want.
It looks like this type doesn't present copy assignation either so you cannot do my_queue = {}; to reset it.
I suspect this is by design.

Joël Lamotte
 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost sync_queue clear

Boost - Users mailing list
Joël,
Thank you for the response. I'll give close() a try.

Ken


------ Original Message ------
Received: 07:08 PM EST, 01/19/2018
From: Klaim - Joël Lamotte via Boost-users <[hidden email]>
To: Boost users list <[hidden email]>
Cc: Klaim - Joël Lamotte <[hidden email]>
Subject: Re: [Boost-users] Boost sync_queue clear




On Sat, Jan 20, 2018 at 12:17 AM, kjw via Boost-users <[hidden email]> wrote:
I am a user of the Boost Thread library experimental class, "sync_queue".

I would like to know if there is a way to remove all elements currently in the queue.

I don't see a "clear()" or "erase()" type method exposed and I don't see an easy way to access the internal container as a workaround.


I think the close() operation is the closest thing to what you want.
It looks like this type doesn't present copy assignation either so you cannot do my_queue = {}; to reset it.
I suspect this is by design.

Joël Lamotte
 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users