summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-24 00:47:01 -0400
committerGravatar Lioncash2018-07-24 00:47:51 -0400
commit76f191ce3695c834fa6c2ffd2991b55e1bb96ccb (patch)
tree0e1064e26b3aa8d6558b425a1af6755d58426f6b /src
parentMerge pull request #790 from bunnei/shader-print-instr (diff)
downloadyuzu-76f191ce3695c834fa6c2ffd2991b55e1bb96ccb.tar.gz
yuzu-76f191ce3695c834fa6c2ffd2991b55e1bb96ccb.tar.xz
yuzu-76f191ce3695c834fa6c2ffd2991b55e1bb96ccb.zip
ipc_helper: Add helper member function for popping enum values to RequestParser
Diffstat (limited to 'src')
-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 8b5b06f31..ac1a633ba 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -298,6 +298,14 @@ public:
298 template <typename First, typename... Other> 298 template <typename First, typename... Other>
299 void Pop(First& first_value, Other&... other_values); 299 void Pop(First& first_value, Other&... other_values);
300 300
301 template <typename T>
302 T PopEnum() {
303 static_assert(std::is_enum_v<T>, "T must be an enum type within a PopEnum call.");
304 static_assert(!std::is_convertible_v<T, int>,
305 "enum type in PopEnum must be a strongly typed enum.");
306 return static_cast<T>(Pop<std::underlying_type_t<T>>());
307 }
308
301 /** 309 /**
302 * @brief Reads the next normal parameters as a struct, by copying it 310 * @brief Reads the next normal parameters as a struct, by copying it
303 * @note: The output class must be correctly packed/padded to fit hardware layout. 311 * @note: The output class must be correctly packed/padded to fit hardware layout.