我在 C 项目中的头文件中有一个结构。
struct tgMethod {
const char *name;
const enum tgAccessModifier access;
const enum tgMethodKind kind;
tgTypeRef return_type;
const tgParams params;
const tgMethod *overrides;
const void *userptr;
const tgObject *(*methodptr)(tgObject *, size_t, tgObject *, void *);
};
Run Code Online (Sandbox Code Playgroud)
在链接这个 C 项目的 C++ 项目中,我有这个结构,它使用 asEntryAllocator<tgMethod>但编译器给出错误:error C2280: "tgMethod &tgMethod::operator =(const tgMethod &)": attempting to reference a deleted function
template<typename T>
struct EntryAllocator {
public:
EntryAllocator() : EntryAllocator(1 << 7) { }
explicit EntryAllocator(size_t max_size) :
_start(0), _count(0), _capacity(max_size), _data((T*)calloc(max_size, …Run Code Online (Sandbox Code Playgroud)