Remove naming requirement for std::pair/std::tuple #85

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/tupname changing 2 files +17 −17
  1. ryanofsky commented at 12:38 AM on September 20, 2023: collaborator

    When converting C++ std::pair and length 2 std::tuple values to and from capn'proto structs, no longer require the struct to have fields named "key" and "value". Instead always map the first pair/tuple element to the first struct field, and the second element to the second field.

    This allows anonymous std::pair and std::tuple types used in the C++ interface to have names and custom Read/Build logic when they are serialized as capn'proto messages.

    For now only length-2 tuples are supported but this could be extended to support converting c++ tuples of arbitrary length to capn'proto structs with the same number of fields.

  2. Remove naming requirement for std::pair/std::tuple
    When converting C++ std::pair and length 2 std::tuple values to and from
    capn'proto structs, no longer require the struct to have fields named "key" and
    "value".  Instead always map the first pair/tuple element to the first struct
    field, and the second element to the second field.
    
    This allows anonymous std::pair and std::tuple types used in the C++ interface
    to have names and custom Read/Build logic when they are serialized as
    capn'proto messages.
    
    For now only length-2 tuples are supported but this could be extended to
    support converting c++ tuples of arbitrary length to capn'proto structs with
    the same number of fields.
    3df497456b
  3. ryanofsky merged this on Sep 20, 2023
  4. ryanofsky closed this on Sep 20, 2023

  5. ryanofsky referenced this in commit 58ced7ba1d on Sep 20, 2023
  6. ryanofsky referenced this in commit a20b010bd6 on Sep 26, 2023
  7. ryanofsky referenced this in commit 74d47b03fc on Sep 26, 2023
  8. ryanofsky referenced this in commit 5184c3c0d3 on Sep 28, 2023
  9. ryanofsky referenced this in commit 187e995e04 on Oct 20, 2023
  10. ryanofsky referenced this in commit 2c2e90150a on Oct 20, 2023
  11. ryanofsky referenced this in commit d8c8a4f345 on Oct 24, 2023
  12. ryanofsky referenced this in commit dc0a2a6726 on Oct 24, 2023
  13. bitcoin-core locked this on Jun 25, 2025
Contributors

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-04-20 18:30 UTC

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