Skip to content

memory: add move assignment to CWeakPointer#113

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
NotPppp1116:weakptr-move-assignment
Jun 21, 2026
Merged

memory: add move assignment to CWeakPointer#113
vaxerski merged 1 commit into
hyprwm:mainfrom
NotPppp1116:weakptr-move-assignment

Conversation

@NotPppp1116

@NotPppp1116 NotPppp1116 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Previously, assigning a CWeakPointer from an rvalue could fall back to copy assignment because the class had move constructors but no move-assignment operators. Add same-type and converting move assignment overloads that swap the stored pointers, matching the other pointer wrappers and avoiding explicit weak-reference count changes.

The tests verify that both forms exchange the stored control blocks without changing either weak-reference count.

Related Hyprland performance cleanup: hyprwm/Hyprland#15147

Comment thread include/hyprutils/memory/WeakPtr.hpp Outdated
@NotPppp1116 NotPppp1116 force-pushed the weakptr-move-assignment branch from c5135ee to c085b61 Compare June 16, 2026 19:12
@vaxerski vaxerski merged commit 9157e1c into hyprwm:main Jun 21, 2026
4 checks passed
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