From e79de3107e0b8e36e5565b615efbf5e15f3aa861 Mon Sep 17 00:00:00 2001 From: LC Date: Tue, 23 Jun 2020 12:00:25 -0400 Subject: [PATCH] gl_resource_manager: Make use of noexcept on move constructors and move assignment operators (#5340) Some of the classes in this file already do this, so we can apply this to the other ones to be consistent. Allows these classes to play nicely and not churn copies when used with standard containers or any other API that makes use of std::move_if_noexcept. --- .../renderer_opengl/gl_resource_manager.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h index 9b9f150e1..55b433858 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.h +++ b/src/video_core/renderer_opengl/gl_resource_manager.h @@ -141,13 +141,13 @@ public: class OGLPipeline : private NonCopyable { public: OGLPipeline() = default; - OGLPipeline(OGLPipeline&& o) { + OGLPipeline(OGLPipeline&& o) noexcept { handle = std::exchange(o.handle, 0); } ~OGLPipeline() { Release(); } - OGLPipeline& operator=(OGLPipeline&& o) { + OGLPipeline& operator=(OGLPipeline&& o) noexcept { Release(); handle = std::exchange(o.handle, 0); return *this; @@ -166,13 +166,13 @@ class OGLBuffer : private NonCopyable { public: OGLBuffer() = default; - OGLBuffer(OGLBuffer&& o) : handle(std::exchange(o.handle, 0)) {} + OGLBuffer(OGLBuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {} ~OGLBuffer() { Release(); } - OGLBuffer& operator=(OGLBuffer&& o) { + OGLBuffer& operator=(OGLBuffer&& o) noexcept { Release(); handle = std::exchange(o.handle, 0); return *this; @@ -191,13 +191,13 @@ class OGLVertexArray : private NonCopyable { public: OGLVertexArray() = default; - OGLVertexArray(OGLVertexArray&& o) : handle(std::exchange(o.handle, 0)) {} + OGLVertexArray(OGLVertexArray&& o) noexcept : handle(std::exchange(o.handle, 0)) {} ~OGLVertexArray() { Release(); } - OGLVertexArray& operator=(OGLVertexArray&& o) { + OGLVertexArray& operator=(OGLVertexArray&& o) noexcept { Release(); handle = std::exchange(o.handle, 0); return *this; @@ -216,13 +216,13 @@ class OGLFramebuffer : private NonCopyable { public: OGLFramebuffer() = default; - OGLFramebuffer(OGLFramebuffer&& o) : handle(std::exchange(o.handle, 0)) {} + OGLFramebuffer(OGLFramebuffer&& o) noexcept : handle(std::exchange(o.handle, 0)) {} ~OGLFramebuffer() { Release(); } - OGLFramebuffer& operator=(OGLFramebuffer&& o) { + OGLFramebuffer& operator=(OGLFramebuffer&& o) noexcept { Release(); handle = std::exchange(o.handle, 0); return *this;