From 76f191ce3695c834fa6c2ffd2991b55e1bb96ccb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Jul 2018 00:47:01 -0400 Subject: ipc_helper: Add helper member function for popping enum values to RequestParser --- src/core/hle/ipc_helpers.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/hle') diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 8b5b06f31..ac1a633ba 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -298,6 +298,14 @@ public: template void Pop(First& first_value, Other&... other_values); + template + T PopEnum() { + static_assert(std::is_enum_v, "T must be an enum type within a PopEnum call."); + static_assert(!std::is_convertible_v, + "enum type in PopEnum must be a strongly typed enum."); + return static_cast(Pop>()); + } + /** * @brief Reads the next normal parameters as a struct, by copying it * @note: The output class must be correctly packed/padded to fit hardware layout. -- cgit v1.2.3