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

LockFreeQueue fails to support move-only types #2067

Closed
gpalmer-latai opened this issue Oct 27, 2023 · 0 comments · Fixed by #2068
Closed

LockFreeQueue fails to support move-only types #2067

gpalmer-latai opened this issue Oct 27, 2023 · 0 comments · Fixed by #2068
Assignees
Labels
bug Something isn't working

Comments

@gpalmer-latai
Copy link

Required information

Operating system:
Ubuntu 20.04 LTS

Compiler version:
GCC 9.4.0

Eclipse iceoryx version:
master branch

Observed result or behaviour:
iox::concurrent::LockFreeQueue fails to compile with move-only types.

Expected result or behaviour:
iox::concurrent::LockFreeQueue should support move-only types.

Conditions where it occurred / Performed steps:
Make the Integer struct in test_concurrent_lockfree_queue.cpp move-only and observe when running bazel test //iceoryx_hoofs/test:hoofs_moduletests:

In file included from iceoryx_hoofs/include/iceoryx_hoofs/concurrent/lockfree_queue.hpp:131,
                 from iceoryx_hoofs/test/moduletests/test_concurrent_lockfree_queue.cpp:20:
iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/lockfree_queue.inl: In instantiation of 'void iox::concurrent::LockFreeQueue<ElementType, Capacity>::writeBufferAt(const uint64_t&, T&&) [with T = {anonymous}::Integer&; ElementType = {anonymous}::Integer; long unsigned int Capacity = 10; uint64_t = long unsigned int]':
iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/resizeable_lockfree_queue.inl:216:24:   required from 'iox::optional<OptionalBaseType> iox::concurrent::ResizeableLockFreeQueue<ElementType, Capacity>::pushImpl(T&&) [with T = {anonymous}::Integer; ElementType = {anonymous}::Integer; long unsigned int MaxCapacity = 10]'
iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/resizeable_lockfree_queue.inl:190:53:   required from 'iox::optional<OptionalBaseType> iox::concurrent::ResizeableLockFreeQueue<ElementType, Capacity>::push(ElementType&&) [with ElementType = {anonymous}::Integer; long unsigned int MaxCapacity = 10]'
iceoryx_hoofs/test/moduletests/test_concurrent_lockfree_queue.cpp:313:9:   required from 'void {anonymous}::LockFreeQueueTest_pushInsertsInFifoOrder_Test<gtest_TypeParam_>::TestBody() [with gtest_TypeParam_ = {anonymous}::Config<iox::concurrent::ResizeableLockFreeQueue, {anonymous}::Integer, 10, 9>]'
iceoryx_hoofs/test/moduletests/test_concurrent_lockfree_queue.cpp:301:1:   required from here
iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/lockfree_queue.inl:173:5: error: use of deleted function '{anonymous}::Integer::Integer(const {anonymous}::Integer&)'
  173 |     new (elementPtr) ElementType(std::forward<T>(value)); // move ctor invoked when available, copy ctor otherwise
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iceoryx_hoofs/test/moduletests/test_concurrent_lockfree_queue.cpp:44:5: note: declared here
   44 |     Integer(const Integer&) = delete;
      |     ^~~~~~~
gpalmer-latai pushed a commit to gpalmer-latai/iceoryx that referenced this issue Oct 27, 2023
@elBoberido elBoberido added the bug Something isn't working label Oct 28, 2023
gpalmer-latai pushed a commit to gpalmer-latai/iceoryx that referenced this issue Oct 30, 2023
elBoberido added a commit that referenced this issue Oct 31, 2023
…lockfreequeue

iox-#2067 Support move-only types in the LockFreeQueue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants