mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 09:40:12 +01:00
ircd::ctx: Enforce semantics on ctx::list.
This commit is contained in:
parent
4727e93f8a
commit
59e921d453
1 changed files with 25 additions and 0 deletions
|
@ -84,9 +84,34 @@ class ircd::ctx::list
|
|||
void remove(ctx *const & = current);
|
||||
|
||||
list() = default;
|
||||
list(list &&) noexcept;
|
||||
list(const list &) = delete;
|
||||
list &operator=(list &&) noexcept;
|
||||
list &operator=(const list &) = delete;
|
||||
~list() noexcept;
|
||||
};
|
||||
|
||||
inline
|
||||
ircd::ctx::list::list(list &&o)
|
||||
noexcept
|
||||
:head{std::move(o.head)}
|
||||
,tail{std::move(o.tail)}
|
||||
{
|
||||
o.head = nullptr;
|
||||
o.tail = nullptr;
|
||||
}
|
||||
|
||||
inline
|
||||
ircd::ctx::list &
|
||||
ircd::ctx::list::operator=(list &&o)
|
||||
noexcept
|
||||
{
|
||||
this->~list();
|
||||
std::swap(head, o.head);
|
||||
std::swap(tail, o.tail);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
ircd::ctx::list::~list()
|
||||
noexcept
|
||||
|
|
Loading…
Add table
Reference in a new issue