mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Add a dealloc and drop_in_place function to the ComponentVTable
This commit is contained in:
parent
4dbf039425
commit
95c4bac794
9 changed files with 105 additions and 26 deletions
|
@ -9,6 +9,11 @@
|
|||
LICENSE END */
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <new>
|
||||
|
||||
namespace vtable {
|
||||
|
||||
template<typename T>
|
||||
struct VRefMut
|
||||
{
|
||||
|
@ -16,6 +21,11 @@ struct VRefMut
|
|||
void *instance;
|
||||
};
|
||||
|
||||
struct Layout {
|
||||
std::size_t size;
|
||||
std::align_val_t align;
|
||||
};
|
||||
|
||||
// For the C++'s purpose, they are all the same
|
||||
template<typename T>
|
||||
using VRef = VRefMut<T>;
|
||||
|
@ -45,5 +55,8 @@ template<typename Base, typename T, typename Flag = void>
|
|||
struct VOffset
|
||||
{
|
||||
const T *vtable;
|
||||
uintptr_t offset;
|
||||
std::uintptr_t offset;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue