-
-
Notifications
You must be signed in to change notification settings - Fork 18
Replace std::variant
with std::expected
for the Result
class
#41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
Signed-off-by: hugsy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the internal implementation of the Result class to use C++23’s std::expected instead of std::variant, and adjusts related usage throughout the codebase. Key changes include:
- Updating the build workflow to use Ubuntu 24.04 instead of 22.04 and removing a Windows ARM configuration.
- Upgrading the LLVM/clang toolchain from version 17 to 18.
- Commenting out output population steps in the workflows which might reflect deprecated or transitional code paths.
Files not reviewed (19)
- CMakeLists.txt: Language not supported
- Modules/Assembly/Include/Disassembler.hpp: Language not supported
- Modules/Assembly/Source/Disassembler.cpp: Language not supported
- Modules/Binary/Include/Win32/PE.hpp: Language not supported
- Modules/Binary/Source/Win32/PE.cpp: Language not supported
- Modules/CTF/Source/Linux/Process.cpp: Language not supported
- Modules/CTF/Source/Linux/Remote.cpp: Language not supported
- Modules/CTF/Source/Win32/Process.cpp: Language not supported
- Modules/CTF/Source/Win32/Remote.cpp: Language not supported
- Modules/Common/Include/Error.hpp: Language not supported
- Modules/Common/Include/Formatters.hpp: Language not supported
- Modules/Common/Include/Handle.hpp: Language not supported
- Modules/Common/Include/Log.hpp: Language not supported
- Modules/Common/Source/Error.cpp: Language not supported
- Modules/Common/Source/Utils.cpp: Language not supported
- Modules/Common/Tests/perf_pwn_common.cpp: Language not supported
- Modules/Common/Tests/tests_pwn_common.cpp: Language not supported
- Modules/FileSystem/Include/Win32/FileSystem.hpp: Language not supported
- Modules/FileSystem/Source/Win32/FileSystem.cpp: Language not supported
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Since we moved to C++23, this PR is one of a few to update code features to a more recent equivalent.
For this PR we replace using
std::variant
withstd::expected
for theResult
class.As a result:
Ok
doesn't really have any meaning, but keep for quality (like Rust'sResult
)Value()
but expands to a xvalue of.value()
.error()
ValueOr()
is now the monadic.value_or()
Success
/Failed
are simplified with.has_value()
or!.has_value()