cpp-driver icon indicating copy to clipboard operation
cpp-driver copied to clipboard

Adapt MemoryOrder definition for C++ 20

Open SeverinLeonhardt opened this issue 3 years ago • 1 comments
trafficstars

When compiling the code with C++ 20 the following error message is produced:

enumerator value for ‘MEMORY_ORDER_RELAXED’ must have integral or unscoped enumeration type

This is because with C++ 20 the type of those values changed to an enum class. The static_cast extracts the numeric values so they can be used here as before.

SeverinLeonhardt avatar Sep 26 '22 10:09 SeverinLeonhardt

Thanks for the contributions @SeverinLeonhardt, this one as well as the other two PRs. Unfortunately I've been completely swamped recently (thus the delay in getting back to you) but I'll try to take a look at these PRs next week!

absurdfarce avatar Oct 07 '22 19:10 absurdfarce

Finally got a chance to take a look at this one @SeverinLeonhardt. That's a nice and elegant way to solve that issue... and degrades nicely for the C++11 case (which is the default).

Many thanks for the solid contribution! And again, my apologies for the delay; we're trying to get back on track here.

absurdfarce avatar Sep 20 '23 04:09 absurdfarce