Add move support to BOOST_STRONG_TYPEDEF - #381
Conversation
Declaring a copy constructor and a copy assignment operator stops the compiler from declaring the move ones, so moving a strong typedef copied the value it wrapped. The documentation said the macro was for primitive types, which would make this pointless, but the implementation has taken class types since the `noexcept` specifications went in. Closes #341.
3d838ce to
a6c6983
Compare
|
I that that the usage BOOST_STRONG_TYPEDEF was removed from the Serialization Library a long time ago. I left it because I became aware that many users had used it independently of the serialization library. Perhaps it's time that this be removed to moved to some common place like core or PFR (?). |
|
I suspect Boosters will not like a macro-based solution for strong typedefs. But I'll ask on the list. |
|
I'm just noting that it seems that a lot of people use it even when they are not using the serialization library itself. I left it in for that reason only. I don't think the serialization library depends upon it. I'm not sure why I used a macro rather than something else. Maybe it was to be C++/03 compatible. Now that the library is requiring C++/11+ , there maybe a better means of implementing the same idea. Perhaps the think to to is to create a new "thing" Boost::strong_typedef, document it, place in a common place, core, config or ? and deprecate BOOST_STRONG_TYPEDEF. This make the library a little bit smaller - almost always a good thing. |
Declaring a copy constructor and a copy assignment operator stops the compiler from declaring the move ones, so moving a strong typedef copied the value it wrapped.
The documentation said the macro was for primitive types, which would make this pointless, but the implementation has taken class types since the
noexceptspecifications went in.Closes #341.