Skip to content

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

Open
bdash wants to merge 1 commit into
devfrom
test_expected
Open

Add bn::base::expected, a backport of C++23's std::expected#8546
bdash wants to merge 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.

`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 added this pull request to stack #8548 September 10, 2026 17:35
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