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

Drop copy constructors creating non-owning variants (stream_t, event_t) #427

Closed
eyalroz opened this issue Oct 10, 2022 · 0 comments
Closed

Comments

@eyalroz
Copy link
Owner

eyalroz commented Oct 10, 2022

Some of our wrappers, which come in both an owning and a non-owning variant, have a copy ctor creating a non-owning variants. While that may be convenient - on second thought, it is too unsafe. Users may make a copy of a local or temporary variable, keep the copy and let the original die - resulting in the equivalent of a dangling reference. In particular, this happens with std::vector's due to our destructors being throwing - something recently exposed via #426 .

So - it's bye-bye copy construction. See also #406 .

@eyalroz eyalroz added the task label Oct 10, 2022
@eyalroz eyalroz self-assigned this Oct 10, 2022
eyalroz added a commit that referenced this issue Oct 10, 2022
…`event_t`; they are now only movable.
eyalroz added a commit that referenced this issue Oct 10, 2022
…`event_t`; they are now only movable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant