Browse Source

ResultVal: Add an rvalue overload of Unwrap()

pull/15/merge
Yuri Kunde Schlesner 9 years ago
parent
commit
4cb47b0278
  1. 7
      src/core/hle/result.h

7
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());
}

Loading…
Cancel
Save