aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/ipc_helpers.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-25 10:25:29 -0700
committerGitHub <noreply@github.com>2018-07-25 10:25:29 -0700
commit5c42cadbc9e03f69b5544fedd152e646182b3af4 (patch)
tree6bbb0c812f4d04105888c46f4bdbcdd5e55d334c /src/core/hle/ipc_helpers.h
parentf445464baf0fade4c205f876f50c370796f19faf (diff)
parent63c605c04af6f236cf13daf71cd6107b122820b5 (diff)
Merge pull request #800 from lioncash/set
set_sys: Implement SetColorSetId()
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:
template <typename First, typename... Other>
void Pop(First& first_value, Other&... other_values);
+ template <typename T>
+ T PopEnum() {
+ static_assert(std::is_enum_v<T>, "T must be an enum type within a PopEnum call.");
+ static_assert(!std::is_convertible_v<T, int>,
+ "enum type in PopEnum must be a strongly typed enum.");
+ return static_cast<T>(Pop<std::underlying_type_t<T>>());
+ }
+
/**
* @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.