BLI: support multiple parameters in Stack.push_as
This commit is contained in:
@@ -232,13 +232,14 @@ class Stack {
|
||||
{
|
||||
this->push_as(std::move(value));
|
||||
}
|
||||
template<typename ForwardT> void push_as(ForwardT &&value)
|
||||
/* This is similar to std::stack::emblace. */
|
||||
template<typename... ForwardT> void push_as(ForwardT &&... value)
|
||||
{
|
||||
if (top_ == top_chunk_->capacity_end) {
|
||||
this->activate_next_chunk(1);
|
||||
}
|
||||
try {
|
||||
new (top_) T(std::forward<ForwardT>(value));
|
||||
new (top_) T(std::forward<ForwardT>(value)...);
|
||||
top_++;
|
||||
size_++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user