mirror of
https://github.com/matrix-construct/construct
synced 2024-10-04 14:48:56 +02: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:
|
public:
|
||||||
hook(const json::members &, decltype(function));
|
hook(const json::members &, decltype(function));
|
||||||
|
hook(decltype(function), const json::members &);
|
||||||
hook(hook &&) = delete;
|
hook(hook &&) = delete;
|
||||||
hook(const hook &) = delete;
|
hook(const hook &) = delete;
|
||||||
virtual ~hook() noexcept;
|
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
|
// 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,
|
ircd::m::hook::hook(const json::members &members,
|
||||||
decltype(function) function)
|
decltype(function) function)
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in a new issue