0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd:Ⓜ️ Add a room::origins::count()er.

This commit is contained in:
Jason Volk 2018-03-03 05:56:42 -08:00
parent 763c14fb7b
commit e95b61d46b
2 changed files with 14 additions and 0 deletions

View file

@ -253,6 +253,7 @@ struct ircd::m::room::origins
bool test(const closure_bool &view) const;
void for_each(const closure &view) const;
size_t count() const;
origins(const m::room &room)
:room{room}

View file

@ -643,6 +643,19 @@ const
// room::origins
//
size_t
ircd::m::room::origins::count()
const
{
size_t ret{0};
for_each([&ret](const string_view &)
{
++ret;
});
return ret;
}
void
ircd::m::room::origins::for_each(const closure &view)
const