Introduce generic saver/loader and make saving const#9
Merged
jermp merged 5 commits intojermp:masterfrom Jun 21, 2024
Merged
Conversation
This was referenced Jun 20, 2024
Owner
|
Hi @adamant-pwn, and thanks for this. This was actually intentional to let us write just one |
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.
Hi @jermp! When merging some sshash-related changes, it occured to us that your libraries currently require passing by non-const reference even when saving something, which, from our perspective, idiomatically should be done with const ref. We also often need to save/load stuff using a general ifstream/ofstream. Due to this I took it upon myself to
The later is, unfortunately, a bit more intrusive, but I strongly believe that it would be a better way to handle this. I also think that while propagating it to actual usecases require some work, it is straightforward enough, as I already did this in custom forks of pthash and sshash. If it is of interest to you, I can make separate pull requests to pthash and sshash to merge the new approach to "visit" them, and also help with the migration in your other projects, if necessary.