mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
C++ VBox: make the destructor delete the content in C++
This commit is contained in:
parent
91acbeed92
commit
48f818df62
3 changed files with 21 additions and 16 deletions
|
|
@ -26,26 +26,24 @@ struct Layout {
|
|||
// For the C++'s purpose, they are all the same
|
||||
template<typename T>
|
||||
using VRef = VRefMut<T>;
|
||||
template<typename T>
|
||||
using VBox = VRefMut<T>;
|
||||
|
||||
template<typename T>
|
||||
using Pin = T;
|
||||
|
||||
/*
|
||||
template<typename T>
|
||||
struct VBox {
|
||||
const T *vtable;
|
||||
void *instance;
|
||||
const T *vtable = nullptr;
|
||||
void *instance = nullptr;
|
||||
VBox(const VBox&) = delete;
|
||||
VBox() = default;
|
||||
VBox&operator=(const VBox&) = delete;
|
||||
~VBox() {
|
||||
if (vtable && instance) {
|
||||
vtable->drop({vtable, instance});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct VRef {
|
||||
const T *vtable;
|
||||
const void *instance;
|
||||
};
|
||||
*/
|
||||
|
||||
struct AllowPin;
|
||||
|
||||
template<typename Base, typename T, typename Flag = void>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue