mirror of
https://github.com/matrix-construct/construct
synced 2025-04-10 20:13:24 +02:00
ircd::ctx: Linkage for default and move semantics of ctx::context.
This commit is contained in:
parent
0eaa2fe211
commit
edbc0984c5
2 changed files with 26 additions and 4 deletions
|
@ -83,10 +83,10 @@ struct ircd::ctx::context
|
||||||
context(function,
|
context(function,
|
||||||
const flags & = (flags)0);
|
const flags & = (flags)0);
|
||||||
|
|
||||||
context() = default;
|
context();
|
||||||
context(context &&) = default;
|
context(context &&) noexcept;
|
||||||
context(const context &) = delete;
|
context(const context &) = delete;
|
||||||
context &operator=(context &&) = default;
|
context &operator=(context &&) noexcept;
|
||||||
context &operator=(const context &) = delete;
|
context &operator=(const context &) = delete;
|
||||||
~context() noexcept;
|
~context() noexcept;
|
||||||
|
|
||||||
|
|
24
ircd/ctx.cc
24
ircd/ctx.cc
|
@ -831,11 +831,19 @@ noexcept
|
||||||
// ctx/context.h
|
// ctx/context.h
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// Linkage here for default construction because ctx is internal.
|
||||||
|
ircd::ctx::context::context()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
ircd::ctx::context::context(const char *const &name,
|
ircd::ctx::context::context(const char *const &name,
|
||||||
const size_t &stack_sz,
|
const size_t &stack_sz,
|
||||||
const flags &flags,
|
const flags &flags,
|
||||||
function func)
|
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
|
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()
|
ircd::ctx::context::~context()
|
||||||
noexcept
|
noexcept
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue