-
Notifications
You must be signed in to change notification settings - Fork 392
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
cxx::optional and cxx::expected adjustments #160
Comments
@elBoberido sadly it is not possible to invalidate an optional when the value is moved out since |
…to and_then and on_error to or_else and deprecated the previous methods Signed-off-by: Christian Eltzschig <[email protected]>
…r or on_success Signed-off-by: Christian Eltzschig <[email protected]>
…on client Signed-off-by: Christian Eltzschig <[email protected]>
Signed-off-by: Christian Eltzschig <[email protected]>
Would you please create a link to the according C++ standards where the adjustments are based on. That makes comparing easier. |
Signed-off-by: Eltzschig Christian (CC-AD/ESW1) <[email protected]>
…-adjustments Iox #160 optional and expected adjustments
Brief feature description
cxx::expected
on_success
andon_error
should be renamed toand_then
andor_else
.cxx::optional
directly from ancxx::expected
with a method called.to_optional()
which returns the value of thecxx::expected
packed inside ancxx:optional
if it contains a value otherwise it returns thecxx::nullopt
cxx::optional
the methodhas_value
should no longer return true since we would like to avoid undefined behaviorcxx::expected
it should no longer be contained. We need the methodshas_value()
andhas_error()
which both should return false in that case. If the methodsand_then()
oror_else()
are called on ancxx::expected
in that state they should terminate.Detailed information
We would further reduce undefined behavior.
The text was updated successfully, but these errors were encountered: