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

Vector exception safety #2

Closed
jxy-s opened this issue Apr 26, 2024 · 1 comment
Closed

Vector exception safety #2

jxy-s opened this issue Apr 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jxy-s
Copy link
Collaborator

jxy-s commented Apr 26, 2024

Description of the feature, modification, idea, or suggestion.

Vector is currently not fully exception safe:

//
// TODO - rad::Vector does not yet support types that might throw exceptions
// when manipulating it. It is the intention of the radiant authors for the
// library to be exception free. Radiant will never throw an exception
// itself, rather it will communicate errors by returning a Result. However,
// the radiant containers may be used with types that do not adhere to this
// philosophy. For rad::Vector to comply to this, it must cleanly handle
// cases where an exception interjects manipulation of it. If an exception
// happens rad::Vector should be in the state prior to the call to
// manipulate it. In other words, an exception occurring when manipulating
// rad::Vector should not leave it in a partially-manipulated state. This
// does not mean it should swallow the exception internally and return an
// error. The exception should propagate from rad::Vector but rad::Vector
// itself should be in a valid state when this happens.
//
RAD_S_ASSERTMSG((IsNoThrowDtor<T> && IsNoThrowDefaultCtor<T> &&
IsNoThrowCopyCtor<T> && IsNoThrowMoveCtor<T> &&
IsNoThrowCopyAssign<T> && IsNoThrowMoveAssign<T>),
"rad::Vector does not yet support types that might throw.");

Proposed implementation details (optional)

All paths in Vector should be exception safe.

@jxy-s jxy-s added the enhancement New feature or request label Apr 26, 2024
@jxy-s
Copy link
Collaborator Author

jxy-s commented Jul 11, 2024

Done by: #27

@jxy-s jxy-s closed this as completed Jul 11, 2024
adam-fonseca pushed a commit to adam-fonseca/radiant-cpp that referenced this issue Jul 22, 2024
Merge in SEN/radiant-cpp from upstream-sync to sensor-main

* commit '1871985157e680418121ba50924e0cbb451cea53':
  remove reserved namespace pollution
  cleanup Atomic
  update bazelversion
  tools links and mounts compat
  tools add required dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant