mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-03 07:04:34 +00:00
Fix C++ formatting
This commit is contained in:
parent
0ba6ef1c24
commit
c6c6564537
1 changed files with 37 additions and 10 deletions
|
@ -10,7 +10,7 @@
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <AvailabilityMacros.h>
|
# include <AvailabilityMacros.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace vtable {
|
namespace vtable {
|
||||||
|
@ -134,18 +134,45 @@ public:
|
||||||
return VRc(inner);
|
return VRc(inner);
|
||||||
}
|
}
|
||||||
|
|
||||||
const X *operator->() const { return &inner->data; }
|
const X *operator->() const
|
||||||
const X &operator*() const { return inner->data; }
|
{
|
||||||
X *operator->() { return &inner->data; }
|
return &inner->data;
|
||||||
X &operator*() { return inner->data; }
|
}
|
||||||
|
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); }
|
VRc<VTable, Dyn> into_dyn() const
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<const VRc<VTable, Dyn> *>(this);
|
||||||
|
}
|
||||||
|
|
||||||
VRef<VTable> borrow() const { return { inner->vtable, inner->data_ptr() }; }
|
VRef<VTable> 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)
|
||||||
friend bool operator!=(const VRc &a, const VRc &b) { return a.inner != b.inner; }
|
{
|
||||||
const VTable *vtable() const { return inner->vtable; }
|
return a.inner == b.inner;
|
||||||
|
}
|
||||||
|
friend bool operator!=(const VRc &a, const VRc &b)
|
||||||
|
{
|
||||||
|
return a.inner != b.inner;
|
||||||
|
}
|
||||||
|
const VTable *vtable() const
|
||||||
|
{
|
||||||
|
return inner->vtable;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename VTable, typename X = Dyn>
|
template<typename VTable, typename X = Dyn>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue