From 4cb47b027888de95aa0d432338909b65b33feec7 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Jun 2017 18:49:46 -0700 Subject: ResultVal: Add an rvalue overload of Unwrap() --- src/core/hle/result.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 5f2cdbb96..55bd8d22f 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -388,11 +388,16 @@ public: } /// Asserts that the result succeeded and returns a reference to it. - T& Unwrap() { + T& Unwrap() & { ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); return **this; } + T&& Unwrap() && { + ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); + return std::move(**this); + } + T&& MoveFrom() { return std::move(Unwrap()); } -- cgit v1.2.3