Skip to content

Constrain HAMT node-map payload detachment APIs - #506

Draft
helly25 wants to merge 1 commit into
implement/interner-character-failure-rollbackfrom
implement/hamt-node-map-payload-constraints
Draft

helly25 wants to merge 1 commit into
implement/interner-character-failure-rollbackfrom
implement/hamt-node-map-payload-constraints

Conversation

@helly25

@helly25 helly25 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Make the public HAMT node-map API advertise its real payload requirements. Operations that detach or clone shared payloads now participate only when the complete key/value entry is nothrow-copy-constructible, preventing invalid templates from surviving until deep implementation errors.

AG;DR

  • constrain persistent and transient try_update on nothrow copy construction of the full value_type;
  • apply the same requirement to lvalue and consuming try_clone_to overloads;
  • retain lookup and mutation support for move-only mapped values where no payload detachment is required;
  • verify the public overload surface with compile-time availability checks for copyable and move-only payload combinations;
  • keep allocation and mutation failure behavior unchanged for supported operations.

Validation:

  • bazel test //mbo/container:hamt_node_map_test
  • focused pre-commit hooks on both changed files, with local clang-tidy intentionally left to CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant