0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 14:38:57 +02:00

ircd:Ⓜ️ Add alternative hook ctor for simple argument syntax reversal.

This commit is contained in:
Jason Volk 2018-03-02 21:12:11 -08:00
parent 0d4083c487
commit 94087f6316
2 changed files with 13 additions and 0 deletions

View file

@ -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;

View file

@ -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