From c7664f11ac793f682c809fedfc9f03b9c6f7aa5a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 22 Jan 2021 13:03:02 +0100 Subject: [PATCH] C++: operator== for VRc --- api/sixtyfps-cpp/include/vtable.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/sixtyfps-cpp/include/vtable.h b/api/sixtyfps-cpp/include/vtable.h index 9c7a82c48..1d14ef10d 100644 --- a/api/sixtyfps-cpp/include/vtable.h +++ b/api/sixtyfps-cpp/include/vtable.h @@ -128,6 +128,13 @@ public: VRc into_dyn() const { return *reinterpret_cast *>(this); } VRef borrow() const { return { inner->vtable, inner->data_ptr() }; } + + friend bool operator==(const VRc &a, const VRc &b) { + return a.inner == b.inner; + } + friend bool operator!=(const VRc &a, const VRc &b) { + return a.inner == b.inner; + } }; template