From 8448897f14385e67a990391d380ccf0133ac5d06 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 23 Apr 2024 19:06:23 -0400 Subject: [PATCH] LibCore: Implement a move operator for Core::Process We implement the move constructor already. A future commit will have code of the form: process = move(other_process); which there is no reason to forbid. --- Userland/Libraries/LibCore/Process.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/Process.h b/Userland/Libraries/LibCore/Process.h index 1ebe90f4fd0..f2295964aec 100644 --- a/Userland/Libraries/LibCore/Process.h +++ b/Userland/Libraries/LibCore/Process.h @@ -59,7 +59,12 @@ public: { } - Process& operator=(Process&& other) = delete; + Process& operator=(Process&& other) + { + m_pid = exchange(other.m_pid, 0); + m_should_disown = exchange(other.m_should_disown, false); + return *this; + } ~Process() {