Unify ReadFieldNew / ReadFieldUpdate#31
Merged
ryanofsky merged 1 commit intobitcoin-core:masterfrom Mar 20, 2020
Merged
Conversation
Replace with ReadField wrapper and CustomReadField hook to be consistent with BuildField / CustomBuildField. This - Makes it more straightforward pass custom types with symmetric CustomReadField / CustomBuildField overloads - Simplifies debugging and overload resolution, removing hacks that allowed ReadFieldNew calls to forward to ReadFieldUpdate calls and vice versa - Enables more flexibility and efficiency within CustomReadField implementations allowing emplacing or updating in the same function based on which is simpler or more efficient. Removes a lot of std::enable_if overload hacks - Should allow clientInvoke to use RVO and construct return values in place instead of copying or moving. This will allow more types to be for supported as IPC return values even if they don't support default construction, copying, or moving. - Improves separation of concerns, avoids need for ReadField callers to know whether callee will emplace or update, avoids need for emplace ReadDest object to have hardcoded support for map, vector, optional, shared_ptr, reference_wrapper types, so they now are implemented the same as any other custom type.
Collaborator
Author
|
Corresponding updates for bitcoin were ryanofsky/bitcoin@cc91cff |
ryanofsky
added a commit
to ryanofsky/libmultiprocess
that referenced
this pull request
Jan 18, 2024
Last remaining uses of these utilities except for ThrowFn were removed in PR "Unify ReadFieldNew / ReadFieldUpdate" bitcoin-core#31 Last remaining use of ThrowFn is removed here. After C++14 it is easily replaced with a perfect-forwarding auto&& lambda. Immediate motivation for this change is to fix C++20 compilers complaining about reference to std::result_of in the unused code bitcoin/bitcoin#29248
ryanofsky
added a commit
that referenced
this pull request
Jan 18, 2024
…helpers 65260d1 util: Drop Bind, BindTuple, ComposeFn, GetFn, and ThrowFn helpers (Ryan Ofsky) Pull request description: Last remaining uses of these utilities except for ThrowFn were removed in #31. Last remaining use of ThrowFn is removed here. After C++14 it is easily replaced with a perfect-forwarding auto&& lambda. Immediate motivation for this change is to fix C++20 compilers complaining about reference to std::result_of in the unused code: bitcoin/bitcoin#29248 Top commit has no ACKs. Tree-SHA512: ecf60074101c04102e1119f08b7201fc81640a63eb7590db93a77af7be7ff80af5262190fe2ba87ce00c5638323ee863f2852942b91fd51d06d35079a00d122d
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replace with ReadField wrapper and CustomReadField hook to be consistent with
BuildField / CustomBuildField. This
Makes it more straightforward pass custom types with symmetric
CustomReadField / CustomBuildField overloads
Simplifies debugging and overload resolution, removing hacks that allowed
ReadFieldNew calls to forward to ReadFieldUpdate calls and vice versa
Enables more flexibility and efficiency within CustomReadField
implementations allowing emplacing or updating in the same function based on
which is simpler or more efficient. Removes a lot of std::enable_if overload
hacks
Should allow clientInvoke to use RVO and construct return values in place
instead of copying or moving. This will allow more types to be for supported
as IPC return values even if they don't support default construction,
copying, or moving.
Improves separation of concerns, avoids need for ReadField callers to know
whether callee will emplace or update, avoids need for emplace ReadDest
object to have hardcoded support for map, vector, optional, shared_ptr,
reference_wrapper types, so they now are implemented the same as any other
custom type.