From eff2b894464caa83550bcc72d75e3427dfcb4ceb Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sat, 17 Apr 2021 19:02:30 +0200 Subject: [PATCH] BLI: support multiple parameters in Stack.push_as --- source/blender/blenlib/BLI_stack.hh | 5 +++-- 1 file 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 void push_as(ForwardT &&value) + /* This is similar to std::stack::emblace. */ + template void push_as(ForwardT &&... value) { if (top_ == top_chunk_->capacity_end) { this->activate_next_chunk(1); } try { - new (top_) T(std::forward(value)); + new (top_) T(std::forward(value)...); top_++; size_++; }