Skip to content
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

add [[nodiscard]] keyword to cxx::expected class #624

Closed
elfenpiff opened this issue Mar 22, 2021 · 2 comments · Fixed by #628
Closed

add [[nodiscard]] keyword to cxx::expected class #624

elfenpiff opened this issue Mar 22, 2021 · 2 comments · Fixed by #628
Assignees
Projects
Milestone

Comments

@elfenpiff
Copy link
Contributor

Brief feature description

When a method is returning a cxx::expected it should never be ignored. The [[nodiscard]] keyword ensures that the user performs at least some kind of error handling.

@elfenpiff elfenpiff added this to the Prio 2 milestone Mar 22, 2021
@elfenpiff elfenpiff added this to To do in v1.0 via automation Mar 22, 2021
@elfenpiff elfenpiff self-assigned this Mar 22, 2021
@mossmaurice
Copy link
Contributor

As [[nodiscard]] is only available from C++17 we might want to use GCC's __attribute__((warn_unused_result)). However, we need to check the QNX manual if that is supported as well.

@elfenpiff
Copy link
Contributor Author

here i would suggest wrapping this is an IOX_NODISCARD which then selects [[nodiscard]] for mac os and windows, and the attribute for gcc

elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 22, 2021
…in errorHandler usage and unit tests

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 22, 2021
…g unit tests

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…g with expected

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…products

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…d should be activated

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…we have the ICEORYX_WARNINGS available

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…conversion warning

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…ay for ubuntu

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…er example

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
@elfenpiff elfenpiff modified the milestones: Prio 2, Prio 1 Mar 23, 2021
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…ing IOX_DISCARD_RESULT instead of c style (void) cast

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…ed' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#624-add-nodiscard-keyword-to-expected
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…s in Release build

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…with error value in publisher example

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 23, 2021
…ts, using error handler instead of terminate

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 24, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 24, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 24, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Mar 24, 2021
v1.0 automation moved this from To do to Done Mar 24, 2021
elfenpiff added a commit that referenced this issue Mar 24, 2021
…-expected

Iox #624 add nodiscard keyword to expected
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…in errorHandler usage and unit tests

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…g unit tests

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…g with expected

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…products

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…d should be activated

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…we have the ICEORYX_WARNINGS available

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…conversion warning

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…ay for ubuntu

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…er example

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…ing IOX_DISCARD_RESULT instead of c style (void) cast

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…ed' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#624-add-nodiscard-keyword-to-expected
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…s in Release build

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…with error value in publisher example

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…ts, using error handler instead of terminate

Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
…card-keyword-to-expected

Iox eclipse-iceoryx#624 add nodiscard keyword to expected
marthtz pushed a commit to boschglobal/iceoryx that referenced this issue May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v1.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants