Boost lockfree use user define type

I tried to use the lock library without locking. However, there is an invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>' when I set the template parameter for the user type.
Are there any solutions?

 typedef struct TMsgBuffer { char m_puBuffer[512]; size_t m_iBufferLen; } tMsgBuffer; boost::lockfree::fifo<tMsgBuffer> fifo; 
+4
source share
1 answer

STATIC_ASSERTION_FAILURE arises from BOOST_STATIC_ASSERT . I suspect Boost.Lockfree has a fifo element size limit. Try again with a lower UDT.

It may also be that Lockfree only works with standard types, so UDT will not be accepted. If in this case you need to save the pointer instead of the actual structure.

0
source

Source: https://habr.com/ru/post/1379411/


All Articles