Commit 01344b6c authored by gabi's avatar gabi

mpcs_q removed default copy ctor and assignment

parent b943265b
......@@ -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) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment