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
Notice I'm converting a DrawableFacade to an AreaFacade in the self dispatch type. This would be an attempt to do something like a classic upcast I suppose where I have an implementation that needs only a subset of the current facade's available interface.
The text was updated successfully, but these errors were encountered:
spectre-ns
changed the title
Returning a proxy from dispatch
[Question] Returning a proxy from dispatch
Sep 13, 2022
@spectre-ns The motivation is valid, but semantics of Self looks a bit weird. If Self is not intended to transfer the ownership of the value to the other proxy (e.g., no asynchronous operation required), maybe it would be more reasonable to return &self rather than pro::make_proxy<AreaFacade>(std::move(self)).
@mingxwa yes you are correct the ownership model here is weird. If I were going to implement this in the wild I would likely make the facade copyable to eliminate the move and prevent transfering ownership. The implicit move could be a gotcha when dispatching self then trying to continue to use that same proxy after the move.
I was mainly targeting the use case where I'm passing proxies around and I have an interface that is more abstract than my current proxy. In that case I would want to 'translate' to the more abstract version.
Would this be a valid implementation or is there some reason I would not want to do this?
Notice I'm converting a DrawableFacade to an AreaFacade in the self dispatch type. This would be an attempt to do something like a classic upcast I suppose where I have an implementation that needs only a subset of the current facade's available interface.
The text was updated successfully, but these errors were encountered: