eclipse-iceoryx / eclipse-iceoryx/iceoryx
Conditional behavior in debug/release mode for cxx::Expects and cxx::Ensures
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 492
- Avg merge
- 18h 57m
- Merged PRs (30d)
- 1
Description
## Brief feature description
Add conditional behavior on debug/release mode for `cxx::Expects` and `cxx::Ensures`.
## Detailed information
Current state is that `cxx::Expects` and `cxx::Ensures` terminate if the condition is not met.
Suggestion to add conditional behavior on debug/release mode for both functions, like in debug mode you will be terminated with a detailed error message and in release mode we continue.
Optional/to be discussed:
- Add a parameter allowing continuation, e. g.:
```
cxx::Expects( myNumber > 0 ); // hard, calls std::terminate always
cxx::Expects( myNumber > 0, ALGORITHM_CAN_CONTINUE); // we can continue even the requirement is not fulfilled
```
- Can there be a `constexpr` version of `cxx::Expects` and `cxx::Ensures`?
Contributor guide
Assessment
This issue has not been assessed yet.