diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-17 20:02:30 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-17 20:06:48 +0300 |
commit | eff2b894464caa83550bcc72d75e3427dfcb4ceb (patch) | |
tree | a13f574c5eab6b6217791fc2cb16fcf25d53939a | |
parent | 686452fb1bcf9454df8d816443925746f6645ca0 (diff) |
BLI: support multiple parameters in Stack.push_as
-rw-r--r-- | source/blender/blenlib/BLI_stack.hh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_stack.hh b/source/blender/blenlib/BLI_stack.hh index 19f77078c5b..c20a9b9ecfa 100644 --- a/source/blender/blenlib/BLI_stack.hh +++ b/source/blender/blenlib/BLI_stack.hh @@ -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_++; } |