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

Improve bool ChangeState() API #441

Closed
dennisklein opened this issue Aug 26, 2022 · 0 comments
Closed

Improve bool ChangeState() API #441

dennisklein opened this issue Aug 26, 2022 · 0 comments
Labels
feature New feature or request
Milestone

Comments

@dennisklein
Copy link
Member

Based on user feedback it seems easy to miss a return value of false (which usually means that the requested transition is illegal in the current state). Possible ideas to improve here were discussed:

  • Add [[nodiscard]]
  • Throw instead (would also naturally lead to error state if not handled - which the user is in favor for)
@dennisklein dennisklein added the feature New feature or request label Aug 26, 2022
@dennisklein dennisklein added this to the v1.5 milestone Aug 26, 2022
dennisklein added a commit to dennisklein/FairMQ that referenced this issue Feb 28, 2023
* Add `[[nodiscard]]` to `bool Device::ChangeState()`
* Introduce throwing variant `void Device::ChangeStateOrThrow()`

resolves FairRootGroup#441
dennisklein added a commit to dennisklein/FairMQ that referenced this issue Feb 28, 2023
* Add `[[nodiscard]]` to `bool Device::ChangeState()`
* Introduce throwing variant `void Device::ChangeStateOrThrow()`

resolves FairRootGroup#441
dennisklein added a commit that referenced this issue Mar 1, 2023
* Add `[[nodiscard]]` to `bool Device::ChangeState()`
* Introduce throwing variant `void Device::ChangeStateOrThrow()`

resolves #441
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant