Improved CustomBuildField for std::optional in IPC/libmultiprocess #251

pull mangoostaa wants to merge 1 commits into bitcoin-core:master from mangoostaa:feature/optional-forward changing 1 files +1 −2
  1. mangoostaa commented at 10:58 AM on March 11, 2026: contributor

    The function now uses std::forward(value) when building the field, so rvalues are forwarded correctly instead of always being treated as lvalues. This resolves the existing FIXME in that code path.

    Details Previously, the implementation forced every optional value to be accessed as an lvalue, which meant rvalues were unnecessarily copied. By applying perfect forwarding, the function now preserves the value category and allows moves where appropriate. The FIXME comment was removed since the intended behavior is now implemented

  2. Use std::forward in CustomBuildField for std::optional to allow move semantics, resolves FIXME 1977b9f3f6
  3. DrahtBot commented at 10:58 AM on March 11, 2026: none

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ryanofsky

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. ryanofsky approved
  5. ryanofsky commented at 4:37 PM on March 23, 2026: collaborator

    Code review ACK 1977b9f3f658dc34dd9c7cd4eab38c0a9be6cc9a. Thanks for the fix! I'm guessing this change became possible after 3a96cdc18f2d1ca202fbc91551f27097fd7ec7f6 from #172 which started to support perfect forwarding

  6. ryanofsky merged this on Mar 23, 2026
  7. ryanofsky closed this on Mar 23, 2026

  8. ryanofsky referenced this in commit c7cdd9dad6 on Mar 26, 2026
  9. ryanofsky referenced this in commit d45e185fe3 on Mar 27, 2026
  10. ryanofsky referenced this in commit db2dc76ee3 on Mar 27, 2026
  11. ryanofsky referenced this in commit 2478a15ef9 on Mar 30, 2026
  12. fanquake referenced this in commit b0f68f0a3a on Mar 30, 2026
  13. fanquake referenced this in commit 7375940eb2 on Apr 1, 2026
  14. Sjors referenced this in commit 65abfa3c1a on Apr 15, 2026
  15. morozow referenced this in commit 08e84496a9 on May 8, 2026
  16. Sjors referenced this in commit 0dd3f5c989 on May 12, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-31 17:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me