Skip to content

Add bn::base::expected, a backport of C++23's std::expected - #8546

Merged
bdash merged 1 commit into
devfrom
test_expected
Sep 16, 2026
Merged

bdash merged 1 commit into
devfrom
test_expected

Conversation

@bdash

@bdash bdash commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

bn::base::expected provides a way to represent either of two values: an expected value of type T or an unexpected value of type E. This is commonly used as the return type of a function that can fail, where T will hold the return value on success and E will hold the error on failure.

Most functionality of std::expected is implemented. The header lists the aspects that were skipped for now.


Unit tests are on the internal branch of the same name.

@bdash
bdash added this pull request to stack #8548 September 10, 2026 17:35
`bn::base::expected` provides a way to represent either of two values:
an expected value of type `T` or an unexpected value of type `E`. This
is commonly used as the return type of a function that can fail, where
`T` will hold the return value on success and `E` will hold the error on
failure.

Most functionality of `std::expected` is implemented. The header lists
the aspects that were skipped for now.
@bdash
bdash merged commit b727b05 into dev Sep 16, 2026
5 checks passed
@bdash
bdash deleted the test_expected branch September 16, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant