I tried to use the boost lockfree library. However, there is an error invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’ when I set the template parameter to user define type.
Is there any to resolve it?
typedef struct TMsgBuffer
{
char m_puBuffer[512];
size_t m_iBufferLen;
} tMsgBuffer;
boost::lockfree::fifo<tMsgBuffer> fifo;
STATIC_ASSERTION_FAILUREarises from aBOOST_STATIC_ASSERT. I suspect Boost.Lockfree has some size limit on the elements of the fifo. Try again with a smaller UDT.It may also be the case that Lockfree only works with standard types, so no UDT’s will be accepted. If that’s case you need to store a pointer instead of the actual structure.