Codechange: Template DoCommand to automagically reflect the parameters of the command proc.

When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
This commit is contained in:
Michael Lutz
2021-10-30 01:31:46 +02:00
parent c88b104ec6
commit e740c24eb7
39 changed files with 320 additions and 229 deletions

View File

@@ -435,7 +435,8 @@ template <Commands Tcmd> struct CommandTraits;
#define DEF_CMD_TRAIT(cmd_, proc_, flags_, type_) \
template<> struct CommandTraits<cmd_> { \
using Args = typename CommandFunctionTraitHelper<decltype(&proc_)>::Args; \
using ProcType = decltype(&proc_); \
using Args = typename CommandFunctionTraitHelper<ProcType>::Args; \
static constexpr Commands cmd = cmd_; \
static constexpr auto &proc = proc_; \
static constexpr CommandFlags flags = (CommandFlags)(flags_); \