summaryrefslogtreecommitdiff
path: root/src/cmd_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_helper.h')
-rw-r--r--src/cmd_helper.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd_helper.h b/src/cmd_helper.h
index 10060dd2d..9396dd414 100644
--- a/src/cmd_helper.h
+++ b/src/cmd_helper.h
@@ -14,6 +14,14 @@
#include "core/enum_type.hpp"
+/**
+ * Extracts a given type from a value.
+ * @tparam T The type of data we're looking for.
+ * @tparam S The offset in the data.
+ * @tparam N The amount of bits to read.
+ * @tparam U The type of data passed to us.
+ * @param v The data to extract the value from.
+ */
template<typename T, uint S, uint N, typename U> static inline T Extract(U v)
{
/* Check if there are enough bits in v */