mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:room::origins: Add a bool for_each() to eventually replace test().
This commit is contained in:
parent
5ba5cea109
commit
cbd149b650
2 changed files with 11 additions and 0 deletions
|
@ -344,6 +344,7 @@ struct ircd::m::room::origins
|
|||
|
||||
bool _test_(const closure_bool &view) const;
|
||||
bool test(const closure_bool &view) const;
|
||||
bool for_each(const closure_bool &view) const;
|
||||
void for_each(const closure &view) const;
|
||||
bool has(const string_view &origin) const;
|
||||
bool only(const string_view &origin) const;
|
||||
|
|
|
@ -1783,6 +1783,16 @@ const
|
|||
});
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::origins::for_each(const closure_bool &view)
|
||||
const
|
||||
{
|
||||
return !test([&view](const string_view &origin)
|
||||
{
|
||||
return !view(origin);
|
||||
});
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::origins::test(const closure_bool &view)
|
||||
const
|
||||
|
|
Loading…
Reference in a new issue