Skip to content

Relocate the contained value through the construction dispatch - #117

Merged
mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/reloc
Nov 22, 2026
Merged

mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/reloc

Conversation

@mingxwa

@mingxwa mingxwa commented Nov 21, 2026 •

Copy link
Copy Markdown
Member
  • Generalized the internal copy dispatch to forward its operand and renamed it construction_dispatch. Relocation now moves the contained value through the same dispatch as copying, so relocate_dispatch is no longer needed.
  • Narrowed the special case in the generated invocation function to the bitwise copy of a bitwise trivially relocatable type, which must not destroy the source. Other types reach the rvalue branch, which moves the value into the destination and then destroys the source. The immediately invoked lambda is gone.
  • Renamed destroy_dispatch to destruction_dispatch to match.
  • Defined both dispatches before the generated invocation function, so the special case names a complete type without a forward declaration.
  • Moved destroying_guard into the rvalue branch as a local class, because that branch is now its only user.

@mingxwa mingxwa changed the title Implement the relocation of the contained value as a dispatch Relocate the contained value through the construction dispatch Nov 22, 2026
- Generalized the internal copy dispatch to forward its operand and renamed it `construction_dispatch`. Relocation now moves the contained value through the same dispatch as copying, so `relocate_dispatch` is no longer needed.
- Narrowed the special case in the generated invocation function to the bitwise copy of a bitwise trivially relocatable type, which must not destroy the source. Other types reach the rvalue branch, which moves the value into the destination and then destroys the source. The immediately invoked lambda is gone.
- Renamed `destroy_dispatch` to `destruction_dispatch` to match.
- Defined both dispatches before the generated invocation function, so the special case names a complete type without a forward declaration.
- Moved `destroying_guard` into the rvalue branch as a local class, because that branch is now its only user.
@mingxwa
mingxwa merged commit 55f13e2 into ngcpp:feature/v5 Nov 22, 2026
20 checks passed
@mingxwa
mingxwa deleted the user/mingxwa/reloc branch November 22, 2026 05:17
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