mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-16 00:45:48 +08:00
Improved circular_q move
This commit is contained in:
parent
31020f9eea
commit
b88c784634
@ -88,13 +88,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void copy_moveable(circular_q &&other) SPDLOG_NOEXCEPT
|
// copy from other&& and reset it to disabled state
|
||||||
|
void copy_moveable(circular_q &&other) SPDLOG_NOEXCEPT
|
||||||
{
|
{
|
||||||
max_items_ = other.max_items_;
|
max_items_ = other.max_items_;
|
||||||
head_ = other.head_;
|
head_ = other.head_;
|
||||||
tail_ = other.tail_;
|
tail_ = other.tail_;
|
||||||
overrun_counter_ = other.overrun_counter_, v_ = std::move(other.v_);
|
overrun_counter_ = other.overrun_counter_;
|
||||||
other.max_items_ = 0; // disable other
|
v_ = std::move(other.v_);
|
||||||
|
|
||||||
|
// put &&other in disabled, but valid state
|
||||||
|
other.max_items_ = 0;
|
||||||
|
other.head_ = other.tail_ = 0;
|
||||||
|
other.overrun_counter_ = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace details
|
} // namespace details
|
||||||
|
Loading…
Reference in New Issue
Block a user