From 2e180a7f148b3b954b7daed20e0a42b53bda8652 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 27 Feb 2019 10:47:42 -0500 Subject: [PATCH] backend/x64/a32_interface: Mark Context move constructor and move assignment as noexcept Provides a more "correct" move constructor/assignment operator, since these relevant functions shouldn't throw exceptions. Has the benefit of playing nicely with std::move_if_noexcept and other noexcept library facilities. --- include/dynarmic/A32/context.h | 4 ++-- src/backend/x64/a32_interface.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/dynarmic/A32/context.h b/include/dynarmic/A32/context.h index 1c67aed8..e3b6e657 100644 --- a/include/dynarmic/A32/context.h +++ b/include/dynarmic/A32/context.h @@ -18,9 +18,9 @@ public: Context(); ~Context(); Context(const Context&); - Context(Context&&); + Context(Context&&) noexcept; Context& operator=(const Context&); - Context& operator=(Context&&); + Context& operator=(Context&&) noexcept; /// View and modify registers. std::array& Regs(); diff --git a/src/backend/x64/a32_interface.cpp b/src/backend/x64/a32_interface.cpp index ccd987aa..eb3a0136 100644 --- a/src/backend/x64/a32_interface.cpp +++ b/src/backend/x64/a32_interface.cpp @@ -222,12 +222,12 @@ struct Context::Impl { Context::Context() : impl(std::make_unique()) { impl->jit_state.ResetRSB(); } Context::~Context() = default; Context::Context(const Context& ctx) : impl(std::make_unique(*ctx.impl)) {} -Context::Context(Context&& ctx) : impl(std::move(ctx.impl)) {} +Context::Context(Context&& ctx) noexcept : impl(std::move(ctx.impl)) {} Context& Context::operator=(const Context& ctx) { *impl = *ctx.impl; return *this; } -Context& Context::operator=(Context&& ctx) { +Context& Context::operator=(Context&& ctx) noexcept { impl = std::move(ctx.impl); return *this; }