prepare new policies for queue

This commit is contained in:
mutouyun 2019-01-17 17:47:43 +08:00
parent be15b2377f
commit 7b5ab36fc1
2 changed files with 3 additions and 3 deletions

View File

@ -280,8 +280,8 @@ public:
using base_t::cursor;
template <typename F>
bool push(F&& f) noexcept {
template <typename F, typename... P>
bool push(F&& f, P&&...) noexcept {
return base_t::push(this, std::forward<F>(f), block_);
}

View File

@ -119,7 +119,7 @@ public:
if (elems_ == nullptr) return false;
if (elems_->push([&](void* p) {
::new (p) T(std::forward<P>(params)...);
})) {
}, std::forward<P>(params)...)) {
waiter_.broadcast();
return true;
}