Fix build: Add missing non-const arrow/deref operators for VRc/Component

This commit is contained in:
Simon Hausmann 2021-07-27 10:52:00 +02:00 committed by Simon Hausmann
parent e97ecea480
commit 661f23760b
2 changed files with 10 additions and 0 deletions

View file

@ -237,6 +237,10 @@ public:
const T *operator->() const { return inner.operator->(); }
/// Dereference operator that implements pointer semantics.
const T &operator*() const { return inner.operator*(); }
/// Arrow operator that implements pointer semantics.
T *operator->() { return inner.operator->(); }
/// Dereference operator that implements pointer semantics.
T &operator*() { return inner.operator*(); }
/// internal function that returns the internal handle
vtable::VRc<private_api::ComponentVTable> into_dyn() const { return inner.into_dyn(); }

View file

@ -124,6 +124,12 @@ public:
const X& operator*() const {
return inner->data;
}
X* operator->() {
return &inner->data;
}
X& operator*() {
return inner->data;
}
VRc<VTable, Dyn> into_dyn() const { return *reinterpret_cast<const VRc<VTable, Dyn> *>(this); }