mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️ Add alternative hook ctor for simple argument syntax reversal.
This commit is contained in:
parent
0d4083c487
commit
94087f6316
2 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
|
|
12
ircd/m/m.cc
12
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
|
||||
|
|
Loading…
Reference in a new issue