-
Notifications
You must be signed in to change notification settings - Fork 85
Make the bounce buffer move constructible and move assignable #898
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
Make the bounce buffer move constructible and move assignable #898
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Well. For a WIP PR, I no longer need the bounce buffer to be moveable. Is there any disadvantage of making it so? I'm not aware of any. But if there is, I can pivot this PR to just adding the unit test. Let me know what you think @madsbk. Thanks! |
Not that I’m aware of. The buffers themselves are allocated on the heap, so making the bounce buffer movable should not make a difference. That said, we could wait with this feature until it is actually needed. I don’t have a strong opinion either way. |
|
might be better to merge this now if it's ready |
|
Thanks for the discussion. |
madsbk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @kingcrimsontianyu
PS: pushed a minor update to the docs
|
Thanks all for your reviews. |
|
/merge |
Currently bounce buffer is non-copyable and non-movable. Creating a vector of bounce buffers requires the use of unique pointers as a workaround (
std::vector<std::unique_ptr<Buffer>>). This PR lifts this limitation by making it move constructible and move assignable.This PR makes the following additional improvements:
const