mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-09-15 00:55:33 +00:00
ResultVal: Add an rvalue overload of Unwrap()
This commit is contained in:
parent
d0888f8548
commit
4cb47b0278
@ -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…
Reference in New Issue
Block a user