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

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ryanofsky

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  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


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-03-29 21:30 UTC

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