mirror of
https://github.com/matrix-construct/construct
synced 2024-06-08 13:08:56 +02:00
ircd: Add function_bool convenience template alias.
This commit is contained in:
parent
47f670b7a2
commit
be1d6ed454
|
@ -26,9 +26,8 @@ namespace ircd::m::dbs
|
|||
/// scan when using this interface, etc).
|
||||
struct ircd::m::event::refs
|
||||
{
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function,
|
||||
const event::idx &, const dbs::ref &
|
||||
>;
|
||||
|
||||
|
|
|
@ -97,9 +97,8 @@ namespace ircd::m::events::refs
|
|||
namespace ircd::m::events::relates
|
||||
{
|
||||
// (source, rel_type, target)
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function,
|
||||
const event::idx &, const m::relates_to &, const event::idx &
|
||||
>;
|
||||
|
||||
|
@ -112,9 +111,9 @@ namespace ircd::m::events::relates
|
|||
namespace ircd::m::events::annotates
|
||||
{
|
||||
// (source, key, target)
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function, const event::idx &, const string_view &, const event::idx &
|
||||
const event::idx &, const string_view &, const event::idx &
|
||||
>;
|
||||
|
||||
// Iterate events in range
|
||||
|
|
|
@ -39,9 +39,8 @@ struct ircd::m::relates_to
|
|||
///
|
||||
struct ircd::m::relates
|
||||
{
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function,
|
||||
const event::idx &, const json::object &, const m::relates_to &
|
||||
>;
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
struct ircd::m::room::content
|
||||
{
|
||||
using entry = pair<uint64_t, m::event::idx>;
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function, const json::object &, const uint64_t &, const event::idx &
|
||||
const json::object &, const uint64_t &, const event::idx &
|
||||
>;
|
||||
|
||||
static const size_t prefetch_max;
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
///
|
||||
struct ircd::m::room::events::horizon
|
||||
{
|
||||
using closure = std::function<bool (const event::id &, const uint64_t &, const event::idx &)>;
|
||||
using closure = util::function_bool
|
||||
<
|
||||
const event::id &, const uint64_t &, const event::idx &
|
||||
>;
|
||||
|
||||
m::room room;
|
||||
|
||||
|
|
|
@ -20,7 +20,10 @@
|
|||
///
|
||||
struct ircd::m::room::events::missing
|
||||
{
|
||||
using closure = std::function<bool (const event::id &, const uint64_t &, const event::idx &)>;
|
||||
using closure = util::function_bool
|
||||
<
|
||||
const event::id &, const uint64_t &, const event::idx &
|
||||
>;
|
||||
|
||||
m::room room;
|
||||
|
||||
|
|
|
@ -47,7 +47,10 @@ namespace ircd::m
|
|||
struct ircd::m::room::events::sounding
|
||||
{
|
||||
using range = std::pair<int64_t, int64_t>;
|
||||
using closure = std::function<bool (const range &, const event::idx &)>;
|
||||
using closure = util::function_bool
|
||||
<
|
||||
const range &, const event::idx &
|
||||
>;
|
||||
|
||||
m::room room;
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ namespace ircd::m
|
|||
///
|
||||
struct ircd::m::room::messages
|
||||
{
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function, const message &, const uint64_t &, const event::idx &
|
||||
const message &, const uint64_t &, const event::idx &
|
||||
>;
|
||||
|
||||
static const event::fetch::opts fopts;
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
namespace ircd::m::trace
|
||||
{
|
||||
using closure = util::closure_bool
|
||||
using closure = util::function_bool
|
||||
<
|
||||
std::function,
|
||||
const event::idx &, const uint64_t &, const m::room::message &
|
||||
>;
|
||||
|
||||
|
|
|
@ -16,9 +16,8 @@ struct ircd::m::user::rooms
|
|||
{
|
||||
struct origins;
|
||||
|
||||
using closure_bool = util::closure_bool
|
||||
using closure_bool = util::function_bool
|
||||
<
|
||||
std::function,
|
||||
const m::room &, const string_view &
|
||||
>;
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@ inline namespace util
|
|||
class F,
|
||||
class... A>
|
||||
using closure_bool = closure<F, bool, A...>;
|
||||
|
||||
template<class... A>
|
||||
using function_bool = closure_bool<std::function, A...>;
|
||||
}}
|
||||
|
||||
template<template<class, class...>
|
||||
|
|
Loading…
Reference in a new issue