cameron314 / concurrentqueue

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
Other
9.87k stars 1.69k forks source link

Get error when compiling with GCC 10.2.1 #314

Closed pengweichu closed 2 years ago

pengweichu commented 2 years ago

I‘ve tried compile it on Debian with GCC 10.2.1, but I got the below errors, please guide me how to fix it.

Thanks

../blockingconcurrentqueue.h:558:77: error: macro "U" passed 2 arguments, but takes just 1 558 | return p != nullptr ? new (p) U(std::forward(a1), std::forward(a2)) : nullptr;

../concurrentqueue.h:3612:19: error: expected type-specifier before ';' token 3612 | new (p + i) U();

../concurrentqueue.h: In static member function 'static U* moodycamel::ConcurrentQueue<T, Traits>::create(A1&&)': ../concurrentqueue.h:3638:35: error: expected type-specifier 3638 | return p != nullptr ? new (p) U(std::forward(a1)) : nullptr;

../concurrentqueue.h:3638:32: error: expected ':' 3638 return p != nullptr ? new (p) U(std::forward(a1)) : nullptr; ^

../concurrentqueue.h:3638:57: error: expected ';' before ':' token 3638 | return p != nullptr ? new (p) U(std::forward(a1)) : nullptr; | ^ ../concurrentqueue.h:3638:57: error: expected primary-expression before ':' token ../concurrentqueue.h: In static member function 'static void moodycamel::ConcurrentQueue<T, Traits>::destroy(U*)': ../concurrentqueue.h:3645:11: error: expected identifier before ';' token 3645 | p->~U();