Skip to content

boost src/ offloading#646

Merged
liuzicheng1987 merged 1 commit intogetml:mainfrom
ron0studios:main
Apr 4, 2026
Merged

boost src/ offloading#646
liuzicheng1987 merged 1 commit intogetml:mainfrom
ron0studios:main

Conversation

@ron0studios
Copy link
Copy Markdown
Contributor

@liuzicheng1987 sorry I think this change got lost during a rebase, but slipped under the radar since all tests still pass without it.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Writer class for Boost serialization by moving method implementations from the header to a source file and utilizing explicit template instantiation for specific archive types. Feedback indicates that this approach is a breaking change for users of other Boost archive types, such as xml_oarchive, and suggests using a separate template implementation file instead. Furthermore, the inclusion of a .cpp file within another source file was identified as a violation of common practices, with a recommendation to use a more appropriate file extension like .tcc.

*ar_ << static_cast<std::uint64_t>(_size);
return OutputArrayType{};
}
OutputArrayType array_as_root(const size_t _size) const;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Moving the implementation of these methods to a .cpp file and using explicit instantiation restricts the Writer class to only the archive types explicitly handled by the library. This is a breaking change for users of other Boost archive types, such as xml_oarchive or custom archives, as they will now encounter linker errors for these non-template methods. To maintain support for arbitrary archives while still improving compile times, consider moving the implementations to a separate header file (e.g., Writer.tcc) and including it at the end of this header, or keep the implementations inline.

@@ -0,0 +1 @@
#include "rfl/boost_serialization/Writer.cpp"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Including a .cpp file is generally discouraged as it can lead to multiple definition errors if the included file is also compiled as a separate translation unit. It also violates common naming conventions for implementation files intended for inclusion. Consider renaming src/rfl/boost_serialization/Writer.cpp to a more appropriate extension like .tcc or .ipp, or moving the code directly into this file.

@liuzicheng1987
Copy link
Copy Markdown
Contributor

@ron0studios, yes, somehow the rebase broke that. But there still seems to be something wrong with it, some tests fail. COuld you take a look?

@liuzicheng1987 liuzicheng1987 merged commit 5fe65c2 into getml:main Apr 4, 2026
181 of 182 checks passed
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.

2 participants