59 + virtual void set_parent(std::weak_ptr<Surface> const&, int id) = 0;
The int id needs to go away.
"Alternatively, we could clean it up by adding an id() to scene::Surface, but I think that's unnecessary, more complex, and would be equally easy to abuse."
Why would that be equally easy to abuse? Ids for a surface would be created at construction time and never change.
" Because "parent" then became effectively not a surface attribute any more."
Perhaps that's a strong hint that it isn't then.
So I think the path to resolve this "needs fixing" is indeed to ad an id to Surface.
59 + virtual void set_parent( std::weak_ ptr<Surface> const&, int id) = 0;
The int id needs to go away.
"Alternatively, we could clean it up by adding an id() to scene::Surface, but I think that's unnecessary, more complex, and would be equally easy to abuse."
Why would that be equally easy to abuse? Ids for a surface would be created at construction time and never change.
" Because "parent" then became effectively not a surface attribute any more."
Perhaps that's a strong hint that it isn't then.
So I think the path to resolve this "needs fixing" is indeed to ad an id to Surface.