-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watchable base connections are not moved #122
Comments
It is correct that the I think however in your example the connection survives because the |
Thanks for the prompt reply! I understand now, the example is indeed not showing the issue. Maybe changing the main to this would be more descriptive of what I am trying to do (I used the main from the counter example). The case below (combined with the class component above), although oversimplified, actually makes the issue manifest:
This is more or less my use-case (or imagine having a vector of This is all stemming from a need to marry value-oriented design with traditional audio DSP classes where there is usually a need for an encapsulated state (which I cannot change), for which I had to create a layer of abstraction that ties together a |
Well, there was an obvious solution that I hadn't tried, namely wrapping a smart pointer around the objects in the vector. That actually mitigates the issue. May I ask what is the reasoning behind a connection not carried over when a reader object is moved/copied? |
I see! Yes I have a similar case. One solution that I have applied in the past is to override moving in my class that contains the readers, and rebind watchers after move. Maybe not entirely satisfying. The current behavior is there because readers are passed around a lot, and normally you pass it to someone that is interested in the data, but the watchers are local to your own "stateful" business. I leave this open because admittedly I would like to do something around this, since it seems like everyone is getting confused about this, and there cases, like this, where the current behavior is actually annoying... |
I have some ideas, that actually could be API breaking changes... |
I was trying to do sth like this (more objects are actually involved inside the component, plus some functionality for my Component, irrelevant to the issue though):
but apparently
watchable_base
does not move connections when the move/copy constructor/assignment is called. Is this on purpose? Or maybe I got this all wrong, any input would be appreciated. Thank you!The text was updated successfully, but these errors were encountered: