Add an into_dyn helper function to C++ VRc

This will be used in more places in the future, so centralize the ugly re-interpret cast.
This commit is contained in:
Simon Hausmann 2020-11-18 15:00:52 +01:00
parent 8b76114083
commit 9c998c9e56
2 changed files with 4 additions and 3 deletions

View file

@ -116,9 +116,8 @@ public:
template<typename Component>
void set_component(const Component &c) const
{
auto self_rc = c.self_weak.lock().value();
sixtyfps_component_window_set_component(
&inner, reinterpret_cast<cbindgen_private::ComponentRc *>(&self_rc));
auto self_rc = c.self_weak.lock().value().into_dyn();
sixtyfps_component_window_set_component(&inner, &self_rc);
}
private: