Skip to content

Add ReadDestTemp function to make it easier to call ReadField with less boilerplate#81

Merged
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/tempdest
Oct 4, 2022
Merged

Add ReadDestTemp function to make it easier to call ReadField with less boilerplate#81
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/tempdest

Conversation

@ryanofsky
Copy link
Copy Markdown
Collaborator

Add RestDestTemp function to simplify ReadField calls that just want to read a field into a new object.

Instead of requiring ReadField callers to construct the object in advance and pass it with ReadDestValue, or to write a custom emplace function and pass it with ReadDestEmplace, they can use RestDestTemp to make ReadField just construct a temporary object internally that can be moved from.

Add test coverage for this. Also add missing documentation comments for ReadDestEmplace and ReadDestValue classes.

…ss boilerplate

Add RestDestTemp function to simplify ReadField callers that just want to read a
field into a new object. Instead of requiring ReadField callers to construct the
object in advance and pass with ReadDestValue, or to write custom emplace
function with ReadDestEmplace, they call RestDestTemp to make ReadField just
return a temporary object that can be moved from.

Add some test coverage for this. Also add missing documentation for
ReadDestEmplace and ReadDestValue classes.
@ryanofsky ryanofsky merged commit 1af83d1 into bitcoin-core:master Oct 4, 2022
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Jun 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant