From 94087f6316897efba1d409f510283cd882319c97 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 2 Mar 2018 21:12:11 -0800 Subject: [PATCH] ircd::m: Add alternative hook ctor for simple argument syntax reversal. --- include/ircd/m/hook.h | 1 + ircd/m/m.cc | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/ircd/m/hook.h b/include/ircd/m/hook.h index 64d89e884..71abca565 100644 --- a/include/ircd/m/hook.h +++ b/include/ircd/m/hook.h @@ -36,6 +36,7 @@ struct ircd::m::hook public: hook(const json::members &, decltype(function)); + hook(decltype(function), const json::members &); hook(hook &&) = delete; hook(const hook &) = delete; virtual ~hook() noexcept; diff --git a/ircd/m/m.cc b/ircd/m/m.cc index 25d2fbf51..bf88fd113 100644 --- a/ircd/m/m.cc +++ b/ircd/m/m.cc @@ -535,6 +535,18 @@ ircd::m::room_id(const mutable_buffer &out, // m/hook.h // +/// Alternative hook ctor simply allowing the the function argument +/// first and description after. +ircd::m::hook::hook(decltype(function) function, + const json::members &members) +:hook +{ + members, std::move(function) +} +{ +} + +/// Primary hook ctor ircd::m::hook::hook(const json::members &members, decltype(function) function) try