mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 02:55:45 +00:00
ResultVal: Add an rvalue overload of Unwrap()
This commit is contained in:
parent
2f5b8ebc73
commit
ec6a30b8bb
1 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue