ircd:Ⓜ️ Assertions for non-empty id constructions.
This commit is contained in:
parent
f6b3b8b758
commit
3c9a4f8c57
|
@ -187,9 +187,11 @@ struct ircd::m::room
|
|||
const vm::copts *const &copts,
|
||||
const event::fetch::opts *const &fopts = nullptr) noexcept;
|
||||
|
||||
room(const id &room_id = {},
|
||||
room(const id &room_id,
|
||||
const event::fetch::opts *const &fopts = nullptr) noexcept;
|
||||
|
||||
room() = default;
|
||||
|
||||
// Index of create event
|
||||
static event::idx index(const id &, std::nothrow_t);
|
||||
static event::idx index(const id &);
|
||||
|
@ -229,7 +231,9 @@ ircd::m::room::room(const id &room_id,
|
|||
,event_id{event_id? event::id{event_id} : event::id{}}
|
||||
,copts{copts}
|
||||
,fopts{fopts}
|
||||
{}
|
||||
{
|
||||
assert(room_id);
|
||||
}
|
||||
|
||||
inline
|
||||
ircd::m::room::room(const id &room_id,
|
||||
|
@ -239,7 +243,9 @@ noexcept
|
|||
:room_id{room_id}
|
||||
,copts{copts}
|
||||
,fopts{fopts}
|
||||
{}
|
||||
{
|
||||
assert(room_id);
|
||||
}
|
||||
|
||||
inline
|
||||
ircd::m::room::room(const id &room_id,
|
||||
|
@ -247,7 +253,9 @@ ircd::m::room::room(const id &room_id,
|
|||
noexcept
|
||||
:room_id{room_id}
|
||||
,fopts{fopts}
|
||||
{}
|
||||
{
|
||||
assert(room_id);
|
||||
}
|
||||
|
||||
inline ircd::m::room::operator
|
||||
const ircd::m::room::id &()
|
||||
|
|
|
@ -74,13 +74,17 @@ struct ircd::m::user
|
|||
event::id::buf deoper();
|
||||
event::id::buf oper();
|
||||
|
||||
user(const id &user_id)
|
||||
:user_id{user_id}
|
||||
{}
|
||||
|
||||
user(const id &user_id);
|
||||
user() = default;
|
||||
};
|
||||
|
||||
inline
|
||||
ircd::m::user::user(const id &user_id)
|
||||
:user_id{user_id}
|
||||
{
|
||||
assert(user_id);
|
||||
}
|
||||
|
||||
inline ircd::m::user::operator
|
||||
const ircd::m::user::id &()
|
||||
const
|
||||
|
|
Loading…
Reference in New Issue