parallel/stack: allow zero capacity construction
This commit is contained in:
parent
ad9d5d991c
commit
ec883c3009
@ -44,6 +44,8 @@ namespace cruft::parallel {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Thread safe swapping with the supplied object
|
||||||
void swap (stack &rhs)
|
void swap (stack &rhs)
|
||||||
{
|
{
|
||||||
std::lock_guard lk0 (m_lock);
|
std::lock_guard lk0 (m_lock);
|
||||||
@ -62,7 +64,8 @@ namespace cruft::parallel {
|
|||||||
: m_cursor (0)
|
: m_cursor (0)
|
||||||
, m_store (capacity)
|
, m_store (capacity)
|
||||||
{
|
{
|
||||||
CHECK_GT (capacity, 0u);
|
// NOTE: a capacity of zero must be supported as it forms part of
|
||||||
|
// how we structure the move operations
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move the value from the top of the stack into an output pointer.
|
/// Move the value from the top of the stack into an output pointer.
|
||||||
|
Loading…
Reference in New Issue
Block a user