mirror of
https://github.com/gelldur/EventBus.git
synced 2025-01-14 01:07:59 +08:00
Fix compile error
Shame on me.
This commit is contained in:
parent
48a14238ff
commit
f9ff982521
@ -39,10 +39,14 @@ public:
|
|||||||
{
|
{
|
||||||
const auto countElements = std::min(limit, _queue.size());
|
const auto countElements = std::min(limit, _queue.size());
|
||||||
processEvents.reserve(countElements);
|
processEvents.reserve(countElements);
|
||||||
std::move(_queue.begin(),
|
auto begin = _queue.begin();
|
||||||
std::next(_queue.begin(), countElements),
|
auto end = std::next(begin, countElements);
|
||||||
std::back_inserter(processEvents));
|
|
||||||
_queue.erase(_queue, std::next(_queue.begin(), countElements));
|
// moved-from range will still contain valid values of the appropriate type, but not
|
||||||
|
// necessarily the same values as before the move. Iterators should be still valid.
|
||||||
|
// see: https://en.cppreference.com/w/cpp/algorithm/move
|
||||||
|
std::move(begin, end, std::back_inserter(processEvents));
|
||||||
|
_queue.erase(begin, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user