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

move only types are not supported #26

Open
tnovotny opened this issue Aug 1, 2016 · 10 comments
Open

move only types are not supported #26

tnovotny opened this issue Aug 1, 2016 · 10 comments

Comments

@tnovotny
Copy link

tnovotny commented Aug 1, 2016

It is currently not possible to get a move only type into the lockfree datastructures. It leades to compile errors.

@timblechmann
Copy link
Collaborator

for some data structures this is by design (the queue requires a trivial assignment operator) for the other data structures, patches are more than welcome

@tnovotny
Copy link
Author

tnovotny commented Aug 2, 2016

I patched spsc_queue so that it works for me. I posted about this in the boost mailing list here:
getting a move only type into spsc_queue.

In the meantime I forked the repository and have a better implementation that uses std::enable_if. The main "issue" is the "detail\copy_payload.hpp" which is used by serveral implementaions so I'm hesitant to change it.

@timblechmann
Copy link
Collaborator

i'm not reading the boost-user list. but you could do a PR and we could discuss it there

@tnovotny
Copy link
Author

tnovotny commented Aug 2, 2016

I'll tidy the stuff up a little a locally, push it, and then do a PR.

@cor3ntin
Copy link

@timblechmann any news on that ? Thanks !

@tnovotny
Copy link
Author

@cor3ntin I made the pull request minimal changes to allow single move only values to be pushed and poped #27 on Aug 3, 2016 and have received no feedback.

@timblechmann
Copy link
Collaborator

thanks for the heads-up.

from the 3 PRs #31 looks best and i'm commenting on this. i only have limited time atm to work on this and no real use-case for move semantics, so it would be great if you guys could pick up that pr and complete it

@tnovotny
Copy link
Author

tnovotny commented Dec 29, 2017

@timblechmann But they do different things. This one works with move-only types such as unique_ptr where as the other simply does some optimizations for move-able types. #31 but fails on move-only types.

@timblechmann
Copy link
Collaborator

#27 will break c++98 compatibility. any PR that will go in should not break compatibility as it may break user code. move-only types should be supported, though.

i don't care too much, which implementation should go in, as long as it's still c++98 compatible, has test coverage and supports both moveable and move-only types :)

@tnovotny
Copy link
Author

tnovotny commented Dec 29, 2017

@timblechmann I'm sure #27 can be made c++98 compatible by simply hiding the functionality via #defines. We can also do them one after another, first move-able and then move-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants