Skip to content

Add move support to BOOST_STRONG_TYPEDEF - #381

Merged
gennaroprota merged 1 commit into
developfrom
fix/add-move-support-to-boost-strong-typedef
Aug 18, 2026
Merged

Add move support to BOOST_STRONG_TYPEDEF#381
gennaroprota merged 1 commit into
developfrom
fix/add-move-support-to-boost-strong-typedef

Conversation

@gennaroprota

@gennaroprota gennaroprota commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
@gennaroprota
gennaroprota force-pushed the fix/add-move-support-to-boost-strong-typedef branch from 3d838ce to a6c6983 Compare August 18, 2026 10:21
@gennaroprota
gennaroprota added this pull request to the merge queue Aug 18, 2026
Merged via the queue into develop with commit 7e55c18 Aug 18, 2026
43 checks passed
@robertramey

Copy link
Copy Markdown
Member

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 (?).

@gennaroprota

Copy link
Copy Markdown
Collaborator Author

I suspect Boosters will not like a macro-based solution for strong typedefs. But I'll ask on the list.

@robertramey

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BOOST_STRONG_TYPEDEF doesn't support move

2 participants