summaryrefslogtreecommitdiff
path: root/src/core/hle/ipc_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/ipc_helpers.h')
-rw-r--r--src/core/hle/ipc_helpers.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index f5bd27a75..7fb0da408 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -300,6 +300,14 @@ public:
300 template <typename First, typename... Other> 300 template <typename First, typename... Other>
301 void Pop(First& first_value, Other&... other_values); 301 void Pop(First& first_value, Other&... other_values);
302 302
303 template <typename T>
304 T PopEnum() {
305 static_assert(std::is_enum_v<T>, "T must be an enum type within a PopEnum call.");
306 static_assert(!std::is_convertible_v<T, int>,
307 "enum type in PopEnum must be a strongly typed enum.");
308 return static_cast<T>(Pop<std::underlying_type_t<T>>());
309 }
310
303 /** 311 /**
304 * @brief Reads the next normal parameters as a struct, by copying it 312 * @brief Reads the next normal parameters as a struct, by copying it
305 * @note: The output class must be correctly packed/padded to fit hardware layout. 313 * @note: The output class must be correctly packed/padded to fit hardware layout.