Closed maxm closed 3 years ago
Well, one way could perhaps be to simply define these in some header file (new seems to be the name),
void * operator new (std::size_t, void * p) { return p ; }
void * operator new[] (std::size_t, void * p) { return p ; }
void operator delete (void *, void *) { }
void operator delete[] (void *, void *) { }
Cibyl has fairly rudimentary C++ support, and this is one of the things I've missed. I've also switched computer, so I'll need to get the cross-compiler built again to get the Cibyl environment working :-)
Yep, that works.
I thought it would be necessary to somehow call the object's constructor in a placement new overload. But it just works.
Thanks! Great work on Cibyl :)
I'm trying to compile a project that uses std::vector from STLport with Cibyl. It fails with errors like:
It seems it can't find an implementation for the placement new operator. A simple way to reproduce the problem is:
I managed to get the program working by substituting the uses of placement new with constructing somewhere else and copying, but I would like to know if there is a better solution.