mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:🆑 Additional info template for confluences of handles.
This commit is contained in:
parent
1870c364f4
commit
019f16cb5e
1 changed files with 26 additions and 0 deletions
26
ircd/cl.cc
26
ircd/cl.cc
|
@ -18,6 +18,7 @@ namespace ircd::cl
|
|||
static int throw_on_error(const int &code);
|
||||
template<class func, class... args> static int call(func&&, args&&...);
|
||||
template<class T = string_view, class F, class id, class param> static T info(F&&, const id &, const param &, const mutable_buffer &);
|
||||
template<class T = string_view, class F, class id0, class id1, class param> static T info(F&&, const id0 &, const id1 &, const param &, const mutable_buffer &);
|
||||
}
|
||||
|
||||
// Runtime state
|
||||
|
@ -1564,6 +1565,31 @@ ircd::cl::info(F&& func,
|
|||
return byte_view<T>(str);
|
||||
}
|
||||
|
||||
template<class T,
|
||||
class F,
|
||||
class id0,
|
||||
class id1,
|
||||
class param>
|
||||
T
|
||||
ircd::cl::info(F&& func,
|
||||
const id0 &i0,
|
||||
const id1 &i1,
|
||||
const param &p,
|
||||
const mutable_buffer &out)
|
||||
{
|
||||
using ircd::data;
|
||||
using ircd::size;
|
||||
|
||||
size_t len {0};
|
||||
call(std::forward<F>(func), i0, i1, p, size(out), data(out), &len);
|
||||
const string_view str
|
||||
{
|
||||
data(out), len
|
||||
};
|
||||
|
||||
return byte_view<T>(str);
|
||||
}
|
||||
|
||||
template<class func,
|
||||
class... args>
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue