diff --git a/include/ircd/ctx/context.h b/include/ircd/ctx/context.h index 6e2291b83..71f4edd7d 100644 --- a/include/ircd/ctx/context.h +++ b/include/ircd/ctx/context.h @@ -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; diff --git a/ircd/ctx.cc b/ircd/ctx.cc index eaac3578d..128821998 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -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(name, stack_sz, flags, ircd::ios)} +:c +{ + std::make_unique(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 {