Commit cb784ec3 authored by Kenton Varda's avatar Kenton Varda

Add noexcept to various move constructors.

parent d2689f41
......@@ -1608,13 +1608,14 @@ DynamicValue::Reader DynamicValue::Builder::asReader() const {
return Reader();
}
DynamicValue::Pipeline::Pipeline(Pipeline&& other): type(other.type) {
DynamicValue::Pipeline::Pipeline(Pipeline&& other) noexcept: type(other.type) {
switch (type) {
case UNKNOWN: break;
case STRUCT: kj::ctor(structValue, kj::mv(other.structValue)); break;
case CAPABILITY: kj::ctor(capabilityValue, kj::mv(other.capabilityValue)); break;
default:
KJ_FAIL_ASSERT("Unexpected pipeline type.", (uint)type) { type = UNKNOWN; break; }
KJ_LOG(ERROR, "Unexpected pipeline type.", (uint)type);
type = UNKNOWN;
break;
}
}
......
......@@ -743,7 +743,7 @@ public:
inline Pipeline(DynamicStruct::Pipeline&& value);
inline Pipeline(DynamicCapability::Client&& value);
Pipeline(Pipeline&& other);
Pipeline(Pipeline&& other) noexcept;
Pipeline& operator=(Pipeline&& other);
~Pipeline() noexcept(false);
......
......@@ -706,7 +706,7 @@ class OrphanBuilder {
public:
inline OrphanBuilder(): segment(nullptr), location(nullptr) { memset(&tag, 0, sizeof(tag)); }
OrphanBuilder(const OrphanBuilder& other) = delete;
inline OrphanBuilder(OrphanBuilder&& other);
inline OrphanBuilder(OrphanBuilder&& other) noexcept;
inline ~OrphanBuilder() noexcept(false);
static OrphanBuilder initStruct(BuilderArena* arena, StructSize size);
......@@ -1017,7 +1017,7 @@ inline PointerReader ListReader::getPointerElement(ElementCount index) const {
// -------------------------------------------------------------------
inline OrphanBuilder::OrphanBuilder(OrphanBuilder&& other)
inline OrphanBuilder::OrphanBuilder(OrphanBuilder&& other) noexcept
: segment(other.segment), location(other.location) {
memcpy(&tag, &other.tag, sizeof(tag)); // Needs memcpy to comply with aliasing rules.
other.segment = nullptr;
......
......@@ -1982,7 +1982,7 @@ private:
RpcSystemBase::RpcSystemBase(VatNetworkBase& network, kj::Maybe<SturdyRefRestorerBase&> restorer,
const kj::EventLoop& eventLoop)
: impl(kj::heap<Impl>(network, restorer, eventLoop)) {}
RpcSystemBase::RpcSystemBase(RpcSystemBase&& other) = default;
RpcSystemBase::RpcSystemBase(RpcSystemBase&& other) noexcept = default;
RpcSystemBase::~RpcSystemBase() noexcept(false) {}
Capability::Client RpcSystemBase::baseRestore(
......
......@@ -82,7 +82,7 @@ class RpcSystemBase {
public:
RpcSystemBase(VatNetworkBase& network, kj::Maybe<SturdyRefRestorerBase&> restorer,
const kj::EventLoop& eventLoop);
RpcSystemBase(RpcSystemBase&& other);
RpcSystemBase(RpcSystemBase&& other) noexcept;
~RpcSystemBase() noexcept(false);
private:
......
......@@ -236,7 +236,7 @@ public:
inline AutoCloseFd(): fd(-1) {}
inline AutoCloseFd(decltype(nullptr)): fd(-1) {}
inline explicit AutoCloseFd(int fd): fd(fd) {}
inline AutoCloseFd(AutoCloseFd&& other): fd(other.fd) { other.fd = -1; }
inline AutoCloseFd(AutoCloseFd&& other) noexcept: fd(other.fd) { other.fd = -1; }
KJ_DISALLOW_COPY(AutoCloseFd);
~AutoCloseFd() noexcept(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment