You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, calling emit() will trigger the instance of Slot belonging to movedPopup, which is as expected. However the value of this in the callback method render() will be that of popup.
This is because the callback function in Slot (which contains the this value of popup) was moved into the Slot instance in movedPopup - this is as intended for Slot copy/move semantics, but when that function contains a pointer to this we get unexpected results, like this.
The text was updated successfully, but these errors were encountered:
The intended use of ass for class decoupling will not invoke the callback of the expected instance when copied or moved.
e.g.
Here, calling
emit()
will trigger the instance ofSlot
belonging tomovedPopup
, which is as expected. However the value ofthis
in the callback methodrender()
will be that ofpopup
.This is because the callback function in
Slot
(which contains thethis
value ofpopup
) was moved into theSlot
instance inmovedPopup
- this is as intended forSlot
copy/move semantics, but when that function contains a pointer tothis
we get unexpected results, like this.The text was updated successfully, but these errors were encountered: