Enhance the flexibility of the BinaryOutputArchive and BinaryInputArchive #267
Merged
greg7mdp merged 3 commits intogreg7mdp:masterfrom Jan 19, 2025
Merged
Enhance the flexibility of the BinaryOutputArchive and BinaryInputArchive #267greg7mdp merged 3 commits intogreg7mdp:masterfrom
BinaryOutputArchive and BinaryInputArchive #267greg7mdp merged 3 commits intogreg7mdp:masterfrom
Conversation
…am and std::istream, allowing for more flexible output/input stream handling
greg7mdp
requested changes
Jan 18, 2025
Owner
There was a problem hiding this comment.
Thanks a lot for the change @tang-hi , that's a good one!
Instead of the need_close_, can you add a member std::function<void()> destruct_, and in the destructor call:
if (destruct_) destruct_();
It won't need to be initialized in the old constructor, and in the new one you can do:
destruct_ = [this]() { delete os_; };
Contributor
Author
|
Thanks for the reply @greg7mdp. I've updated the code based on your feedback |
greg7mdp
approved these changes
Jan 19, 2025
Owner
|
Thanks again for the change @tang-hi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the flexibility of the
BinaryOutputArchiveandBinaryInputArchiveclasses by enabling them to operate on a wider range of stream types.Currently,
BinaryOutputArchivecan only serialize a single map object to a file. This restriction prevents users from storing a combination of data types within the same file, such as a map alongside integers, floats, and strings.