From eba3bb9d219283ffc2a7610d925aa157a81b6e4a Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 10 Apr 2021 02:23:17 -0700 Subject: hle: ipc_helpers: Add methods for copy/move references. --- src/core/hle/ipc_helpers.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 224bee950..8f12616bd 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -217,9 +217,15 @@ public: template void PushMoveObjects(O*... pointers); + template + void PushMoveObjects(O&... pointers); + template void PushCopyObjects(O*... pointers); + template + void PushCopyObjects(O&... pointers); + private: u32 normal_params_size{}; u32 num_handles_to_copy{}; @@ -304,7 +310,15 @@ template inline void ResponseBuilder::PushCopyObjects(O*... pointers) { auto objects = {pointers...}; for (auto& object : objects) { - context->AddCopyObject(std::move(object)); + context->AddCopyObject(object); + } +} + +template +inline void ResponseBuilder::PushCopyObjects(O&... pointers) { + auto objects = {&pointers...}; + for (auto& object : objects) { + context->AddCopyObject(object); } } @@ -312,7 +326,15 @@ template inline void ResponseBuilder::PushMoveObjects(O*... pointers) { auto objects = {pointers...}; for (auto& object : objects) { - context->AddMoveObject(std::move(object)); + context->AddMoveObject(object); + } +} + +template +inline void ResponseBuilder::PushMoveObjects(O&... pointers) { + auto objects = {&pointers...}; + for (auto& object : objects) { + context->AddMoveObject(object); } } -- cgit v1.2.3