boostorg / lockfree

Boost.Lockfree
125 stars 86 forks source link

move only types are not supported #26

Open tnovotny opened 8 years ago

tnovotny commented 8 years ago

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

timblechmann commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

tnovotny commented 8 years ago

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

cor3ntin commented 6 years ago

@timblechmann any news on that ? Thanks !

tnovotny commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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.