From 44b1ea9202a8b7e414068cfaec56624de026fe18 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 21 Feb 2020 20:08:03 -1000 Subject: [PATCH] Use std::swap for DynamicLibrary move assign --- VulkanHppGenerator.cpp | 3 +-- vulkan/vulkan.hpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 2ca8576..6cc3ea0 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1145,8 +1145,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic(std::string & str) DynamicLoader &operator=( DynamicLoader && other ) VULKAN_HPP_NOEXCEPT { m_success = other.m_success; - m_library = other.m_library; - other.m_library = nullptr; + std::swap(m_library, other.m_library); return *this; } diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 7132c4d..0eb5af9 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -72528,8 +72528,7 @@ namespace VULKAN_HPP_NAMESPACE DynamicLoader &operator=( DynamicLoader && other ) VULKAN_HPP_NOEXCEPT { m_success = other.m_success; - m_library = other.m_library; - other.m_library = nullptr; + std::swap(m_library, other.m_library); return *this; }