diff --git a/include/window.hpp b/include/window.hpp index 5f006a1..1e6a2cb 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -71,7 +71,7 @@ namespace gui { Window &operator=(const Window &) = delete; - Window &operator=(Window &&other) noexcept; + Window &operator=(Window other) noexcept; }; void color_10_bits() noexcept; diff --git a/src/window.cpp b/src/window.cpp index 1077515..8473492 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -89,9 +89,9 @@ namespace gui { glfwMakeContextCurrent(wwindow.get()); } - Window &Window::operator=(Window &&other) noexcept { - wwindow = std::move(other.wwindow); - modules = std::move(other.modules); + Window &Window::operator=(Window other) noexcept { + std::swap(wwindow, other.wwindow); + std::swap(modules, other.modules); glfwSetWindowUserPointer(wwindow.get(), &modules); return *this; }