0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd:🆑 Additional info template for confluences of handles.

This commit is contained in:
Jason Volk 2021-04-03 12:22:56 -07:00
parent 1870c364f4
commit 019f16cb5e

View file

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