diff --git a/include/ircd/cl.h b/include/ircd/cl.h index 6761f7ca6..d44bf9ba1 100644 --- a/include/ircd/cl.h +++ b/include/ircd/cl.h @@ -100,6 +100,7 @@ struct ircd::cl::kern public: void arg(const int, data &); + template kern(code &, const string_view &name, argv&&...); kern(code &, const string_view &name); kern() = default; kern(kern &&) noexcept; @@ -195,3 +196,24 @@ noexcept other.context = nullptr; return *this; } + +template +inline +ircd::cl::kern::kern(code &c, + const string_view &name, + argv&&... a) +:kern{c, name} +{ + constexpr uint argc + { + sizeof...(a) + }; + + data *const datas[argc] + { + std::addressof(a)... + }; + + for(uint i(0); i < argc; ++i) + this->arg(i, *datas[i]); +}