diff options
| author | 2017-06-18 18:49:46 -0700 | |
|---|---|---|
| committer | 2017-06-18 18:49:46 -0700 | |
| commit | 4cb47b027888de95aa0d432338909b65b33feec7 (patch) | |
| tree | 03d8acb029c860ffd85c3a2ba277174b3d2224b5 /src | |
| parent | Merge pull request #2776 from wwylele/geo-factor (diff) | |
| download | yuzu-4cb47b027888de95aa0d432338909b65b33feec7.tar.gz yuzu-4cb47b027888de95aa0d432338909b65b33feec7.tar.xz yuzu-4cb47b027888de95aa0d432338909b65b33feec7.zip | |
ResultVal: Add an rvalue overload of Unwrap()
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/result.h | 7 |
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: | |||
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | /// Asserts that the result succeeded and returns a reference to it. | 390 | /// Asserts that the result succeeded and returns a reference to it. |
| 391 | T& Unwrap() { | 391 | T& Unwrap() & { |
| 392 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); | 392 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); |
| 393 | return **this; | 393 | return **this; |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | T&& Unwrap() && { | ||
| 397 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); | ||
| 398 | return std::move(**this); | ||
| 399 | } | ||
| 400 | |||
| 396 | T&& MoveFrom() { | 401 | T&& MoveFrom() { |
| 397 | return std::move(Unwrap()); | 402 | return std::move(Unwrap()); |
| 398 | } | 403 | } |