Erwin Coumans wrote:
It depends which platform and compiler.
I tried compiling it under Mac OSX/gcc, Linux gcc, and Windows Visual Studio 2005 and all work fine. Using <new> doesn't work on some of those platforms. Note we need both memcpy and placement new.
So... which platform/compiler combo is broken right now?
Thanks,
Erwin
Well, standard conformant ones should have it in <new> (thats what ISO 14882/2003 says at least,) But ok.. might need both then.
The compiler I used that hit the problem was VC 2005 (for Xenon), however I did a small test here to work out what actually is needed and it seems like this:
VC 2005 (both win32 and xenon) needs <new> for placement new and <memory.h> for memcpy. That placement new works without <new> on win32 seems to be due to it getting included indirectly somewhere in bullet. This is also what the documentation states
The code I used for testing was a completely empty cpp file containing only
Code:
void a()
{
void *b = 0;
int *i = new (b) int;
}