Skip to content
Snippets Groups Projects
Commit 76f191ce authored by Lioncash's avatar Lioncash
Browse files

ipc_helper: Add helper member function for popping enum values to RequestParser

parent 47ac3691
No related branches found
No related tags found
No related merge requests found
...@@ -298,6 +298,14 @@ public: ...@@ -298,6 +298,14 @@ public:
template <typename First, typename... Other> template <typename First, typename... Other>
void Pop(First& first_value, Other&... other_values); 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 * @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. * @note: The output class must be correctly packed/padded to fit hardware layout.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment