[PR #59] [MERGED] Add Result<T, E> type #1251

Closed
opened 2026-02-27 21:11:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/59
Author: @wheremyfoodat
Created: 10/19/2023
Status: Merged
Merged: 10/19/2023
Merged by: @georgemoralis

Base: mainHead: result


📝 Commits (1)

📊 Changes

4 files changed (+1244 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+1 -0)
third-party/result/LICENSE (+201 -0)
third-party/result/README.md (+132 -0)
third-party/result/include/result.hpp (+910 -0)

📄 Description

This PR adds a small Result type which allows function to return either a value of type T or an error of type E.

This can be used all over HLE code. For example, opening a file can return a Result<FileHandle, OpenFileError> which returns either a FileHandle object if opening the file succeeds, or a specific error to show why it failed otherwise.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/59 **Author:** [@wheremyfoodat](https://github.com/wheremyfoodat) **Created:** 10/19/2023 **Status:** ✅ Merged **Merged:** 10/19/2023 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `result` --- ### 📝 Commits (1) - [`077b254`](https://github.com/shadps4-emu/shadPS4/commit/077b254a4fdadbacffbcf2e2f12e19ac59cff1b1) Add Result<T, E> type ### 📊 Changes **4 files changed** (+1244 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -0) ➕ `third-party/result/LICENSE` (+201 -0) ➕ `third-party/result/README.md` (+132 -0) ➕ `third-party/result/include/result.hpp` (+910 -0) </details> ### 📄 Description This PR adds a small `Result` type which allows function to return either a value of type `T` or an error of type `E`. This can be used all over HLE code. For example, opening a file can return a `Result<FileHandle, OpenFileError>` which returns either a `FileHandle` object if opening the file succeeds, or a specific error to show why it failed otherwise. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:11:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1251
No description provided.