-
Notifications
You must be signed in to change notification settings - Fork 60
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
Require Send
for T
in Queue
instead of Copy
#75
Conversation
I jumped the gun a bit on this. There are some remaining issues:
|
3d5d80e
to
2267004
Compare
Fixed the above point. Also, in |
Copy
Send
for T
in Queue
instead of Copy
Sorry for the delay in getting to this! I think it's a great point and it makes sense that if you're giving a value to the queue that it could be owned by the queue.
|
I think you're right on this. In theory, the compiler could use the memory for something else after the call to
Returning it with the
Yes, no need to zero it out. |
By requiring items to be `Copy` we reduce the queue to only work with primitives. What is more appropriate here is to require that the item is `Send` and use move semantics instead of copy.
2267004
to
d3dbca3
Compare
Using Had to add new error type to return item in error case. I just propagate the |
LGTM, thanks! Good call on |
By requiring items to be
Copy
we reduce the queue to only work with primitives. But, queue dosn't requireCopy
to send items. Yes, they are technically copied over to the Queue buffer, but semantically this is a move, and havingsend()
consume it's argument provides the move semantics.The PR removes the
Copy
bound fromQueue
.