I am trying to include rapidxml in my current project. However, it will not be built.
Visual Studio will complain about this piece of code (rapidxml.hpp: 419 + 451):
419: void *memory = allocate_aligned(sizeof(xml_attribute<Ch>)); 420: xml_attribute<Ch> *attribute = new(memory) xml_attribute<Ch>;
The compiler will say
rapidxml.hpp (420): Error C2061: Syntax error: identifier 'memory'
And I see how this confuses the compiler. It scares me too. What does the (memory) part of the new(memory) xml_attribute<Ch> do there?
If I delete this part (memory) , it just compiles.
In addition, gcc compiles it just fine with (memory) enabled.
Edit:
Oh, and I overloaded new with DEBUG_NEW to do some memory debugging. DEBUG_NEW does not support posting new.
source share