summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-18 18:49:46 -0700
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-18 18:49:46 -0700
commit4cb47b027888de95aa0d432338909b65b33feec7 (patch)
tree03d8acb029c860ffd85c3a2ba277174b3d2224b5 /src
parentd0888f85485c4e064371e03f34facc1990553114 (diff)
ResultVal: Add an rvalue overload of Unwrap()
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/result.h7
1 files changed, 6 insertions, 1 deletions
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());
}