10 May
2016
10 May
'16
2:29 p.m.
On Tuesday, 10 May 2016 17:28:43 MSK Peter Dimov wrote:
Tim Blechmann wrote:
class tagged_index {
public: typedef boost::uint16_t tag_t; typedef boost::uint16_t index_t;
protected: index_t index; tag_t tag;
};
This is by design - your tagged_index has align 2, size 4, triggering the need for my atomic alignment fix.
boost lockfree ensure alignment of the atomics, so this warning is a false positive. sending a warning is good and nice, but a compile error is overkill imho. this code dates back before c++11 and still supports c++03 compilers.
You can in principle fix that by adding __declspec(align(4)) to tagged_index on MSVC.
...or a more portable BOOST_ALIGNMENT(4).