-
Notifications
You must be signed in to change notification settings - Fork 402
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
Better align 'iox::expected' with 'std::expected' #1969
Comments
… 'expected' with success value
@elBoberido Thanks for creating the issue! 🙏 Do you also see possible extensions like a try operator macro in the scope of this issue?
I don't think having a default c'tor with |
@mossmaurice this is just a proposal and we can omit some of the ctors or implicit conversion if we deem them unfit for safety. A try macro would be done in a separate issue. This is mainly for the alignment with the |
…-expected iox-#1969 rework constructors for expected
…td-expected-and-add-convenience-free-functions iox-#1969 align iox expected to std expected and add convenience free functions
Brief feature description
Currently the
iox::expected
differs from the newly introduced C++23std::expected
. To make it easier for developer already familiar withstd::expected
the custom implementation in iceoryx should be aligned where possible.Detailed information
In scope:
implicit conversion from-> we will not have implicit conversion; for safety code it is better to be explicitT
default ctor creates an expected with a-> we will not have default ctors; for safety code it is better to be explicitT
ifT
has a default ctoriox::unexpected
,iox::unexpect_t
andiox::unexpect
iox::ok(...)
andiox::err(...)
as convenience function due to missing CTAD in C++14iox::success
andiox::error
toiox::detail::ok
andiox::detail::err
iox::expected<T, E>::create_value
andiox::expected<T, E>::create_error
in favor of ctors withiox::in_place
andiox::unexpect
iox::expected<T, E>::has_value
iox::expected<T, E>::value
and deprecation ofiox::expected<T, E>::get_value
iox::expected<T, E>::error
and deprecation ofiox::expected<T, E>::get_error
Out of scope
transform
and_then
andor_else
The text was updated successfully, but these errors were encountered: