mirror of
https://github.com/matrix-construct/construct
synced 2024-05-16 01:43:49 +02:00
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 vm::copts *const &copts,
|
||||||
const event::fetch::opts *const &fopts = nullptr) noexcept;
|
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;
|
const event::fetch::opts *const &fopts = nullptr) noexcept;
|
||||||
|
|
||||||
|
room() = default;
|
||||||
|
|
||||||
// Index of create event
|
// Index of create event
|
||||||
static event::idx index(const id &, std::nothrow_t);
|
static event::idx index(const id &, std::nothrow_t);
|
||||||
static event::idx index(const id &);
|
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{}}
|
,event_id{event_id? event::id{event_id} : event::id{}}
|
||||||
,copts{copts}
|
,copts{copts}
|
||||||
,fopts{fopts}
|
,fopts{fopts}
|
||||||
{}
|
{
|
||||||
|
assert(room_id);
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
ircd::m::room::room(const id &room_id,
|
ircd::m::room::room(const id &room_id,
|
||||||
|
@ -239,7 +243,9 @@ noexcept
|
||||||
:room_id{room_id}
|
:room_id{room_id}
|
||||||
,copts{copts}
|
,copts{copts}
|
||||||
,fopts{fopts}
|
,fopts{fopts}
|
||||||
{}
|
{
|
||||||
|
assert(room_id);
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
ircd::m::room::room(const id &room_id,
|
ircd::m::room::room(const id &room_id,
|
||||||
|
@ -247,7 +253,9 @@ ircd::m::room::room(const id &room_id,
|
||||||
noexcept
|
noexcept
|
||||||
:room_id{room_id}
|
:room_id{room_id}
|
||||||
,fopts{fopts}
|
,fopts{fopts}
|
||||||
{}
|
{
|
||||||
|
assert(room_id);
|
||||||
|
}
|
||||||
|
|
||||||
inline ircd::m::room::operator
|
inline ircd::m::room::operator
|
||||||
const ircd::m::room::id &()
|
const ircd::m::room::id &()
|
||||||
|
|
|
@ -74,13 +74,17 @@ struct ircd::m::user
|
||||||
event::id::buf deoper();
|
event::id::buf deoper();
|
||||||
event::id::buf oper();
|
event::id::buf oper();
|
||||||
|
|
||||||
user(const id &user_id)
|
user(const id &user_id);
|
||||||
:user_id{user_id}
|
|
||||||
{}
|
|
||||||
|
|
||||||
user() = default;
|
user() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline
|
||||||
|
ircd::m::user::user(const id &user_id)
|
||||||
|
:user_id{user_id}
|
||||||
|
{
|
||||||
|
assert(user_id);
|
||||||
|
}
|
||||||
|
|
||||||
inline ircd::m::user::operator
|
inline ircd::m::user::operator
|
||||||
const ircd::m::user::id &()
|
const ircd::m::user::id &()
|
||||||
const
|
const
|
||||||
|
|
Loading…
Reference in a new issue