0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::ctx: Linkage for default and move semantics of ctx::context.

This commit is contained in:
Jason Volk 2018-08-26 19:57:55 -07:00
parent 0eaa2fe211
commit edbc0984c5
2 changed files with 26 additions and 4 deletions

View file

@ -83,10 +83,10 @@ struct ircd::ctx::context
context(function,
const flags & = (flags)0);
context() = default;
context(context &&) = default;
context();
context(context &&) noexcept;
context(const context &) = delete;
context &operator=(context &&) = default;
context &operator=(context &&) noexcept;
context &operator=(const context &) = delete;
~context() noexcept;

View file

@ -831,11 +831,19 @@ noexcept
// ctx/context.h
//
// Linkage here for default construction because ctx is internal.
ircd::ctx::context::context()
{
}
ircd::ctx::context::context(const char *const &name,
const size_t &stack_sz,
const flags &flags,
function func)
:c{std::make_unique<ctx>(name, stack_sz, flags, ircd::ios)}
:c
{
std::make_unique<ctx>(name, stack_sz, flags, ircd::ios)
}
{
auto spawn
{
@ -920,6 +928,20 @@ ircd::ctx::context::context(function func,
{
}
ircd::ctx::context::context(context &&other)
noexcept
:c{std::move(other.c)}
{
}
ircd::ctx::context &
ircd::ctx::context::operator=(context &&other)
noexcept
{
std::swap(this->c, other.c);
return *this;
}
ircd::ctx::context::~context()
noexcept
{