Async++ unknown
Async (co_await/co_return) code for C++
|
A threadsafe (mutex protected) queue. More...
#include <asyncpp/threadsafe_queue.h>
Public Member Functions | |
template<typename... Args> | |
threadsafe_queue (Args &&... args) | |
Construct a new queue. | |
threadsafe_queue (const threadsafe_queue &other) | |
threadsafe_queue (threadsafe_queue &&other) | |
threadsafe_queue & | operator= (const threadsafe_queue &other) |
threadsafe_queue & | operator= (threadsafe_queue &&other) |
std::optional< T > | pop () |
Pop the first element from the queue. | |
void | push (T val) |
Push an element to the queue. | |
template<typename... Args> | |
void | emplace (Args &&... args) |
Emplace a new element to the queue. | |
A threadsafe (mutex protected) queue.
T | Type of the contained elements |
Container | Type of the container to use, defaults to std::deque<T> |
|
inlineexplicit |
Construct a new queue.
args | Arguments to forward to the container constructor |
|
inline |
Emplace a new element to the queue.
args | Arguments to forward to the element constructor |
|
inline |
Pop the first element from the queue.
|
inline |
Push an element to the queue.
val | The element to push |