mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									7444c95132
								
							
						
					
					
						commit
						e79de3107e
					
				
					 1 changed files with 8 additions and 8 deletions
				
			
		|  | @ -141,13 +141,13 @@ public: | |||
| class OGLPipeline : private NonCopyable { | ||||
| public: | ||||
|     OGLPipeline() = default; | ||||
|     OGLPipeline(OGLPipeline&& o) { | ||||
|     OGLPipeline(OGLPipeline&& o) noexcept { | ||||
|         handle = std::exchange<GLuint>(o.handle, 0); | ||||
|     } | ||||
|     ~OGLPipeline() { | ||||
|         Release(); | ||||
|     } | ||||
|     OGLPipeline& operator=(OGLPipeline&& o) { | ||||
|     OGLPipeline& operator=(OGLPipeline&& o) noexcept { | ||||
|         Release(); | ||||
|         handle = std::exchange<GLuint>(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; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue