Skip to content

TM::Optional: Run destructor when clearing the value#2860

Open
herwinw wants to merge 4 commits into
natalie-lang:masterfrom
herwinw:optional_placement_new
Open

TM::Optional: Run destructor when clearing the value#2860
herwinw wants to merge 4 commits into
natalie-lang:masterfrom
herwinw:optional_placement_new

Conversation

@herwinw
Copy link
Copy Markdown
Member

@herwinw herwinw commented Dec 20, 2025

No description provided.

@herwinw herwinw force-pushed the optional_placement_new branch from f91a047 to b3c7f0f Compare December 20, 2025 17:28
This is probably a leftover from debugging.
This is done with placement new and manually calling the destructors.
This streamlines the move constructor and move assignment operators by
simply copying the bytes instead of calling constructors and
destructors.
@herwinw herwinw force-pushed the optional_placement_new branch 2 times, most recently from 789ca48 to 854197e Compare December 21, 2025 14:06
@herwinw herwinw force-pushed the optional_placement_new branch from 854197e to 791b16e Compare December 21, 2025 14:06
@seven1m
Copy link
Copy Markdown
Member

seven1m commented Dec 22, 2025

Can you write some descriptive text for this? What was the motivation?

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.

2 participants