mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
mpcs_q removed default copy ctor and assignment
This commit is contained in:
parent
b943265b94
commit
01344b6c8b
@ -71,7 +71,7 @@ class mpsc_q
|
||||
|
||||
public:
|
||||
using item_type = T;
|
||||
mpsc_q(size_t max_size) :
|
||||
explicit mpsc_q(size_t max_size) :
|
||||
_max_size(max_size),
|
||||
_size(0),
|
||||
_stub(),
|
||||
@ -80,6 +80,9 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
mpsc_q(const mpsc_q&) = delete;
|
||||
mpsc_q& operator=(const mpsc_q&) = delete;
|
||||
|
||||
~mpsc_q()
|
||||
{
|
||||
clear();
|
||||
@ -116,12 +119,10 @@ public:
|
||||
// Empty the queue by popping all its elements
|
||||
void clear()
|
||||
{
|
||||
|
||||
while (mpscq_node_t* node = pop_node())
|
||||
{
|
||||
--_size;
|
||||
delete(node);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -139,6 +140,9 @@ private:
|
||||
T value;
|
||||
|
||||
mpscq_node_t() :next(nullptr) {}
|
||||
mpscq_node_t(const mpscq_node_t&) = delete;
|
||||
mpscq_node_t& operator=(const mpscq_node_t&) = delete;
|
||||
|
||||
explicit mpscq_node_t(const T& value):
|
||||
next(nullptr),
|
||||
value(value) {}
|
||||
|
Loading…
Reference in New Issue
Block a user