我正在尝试将 rapidxml 包含到我当前的项目中。但是,它不会构建。
Visual Studio 会抱怨这段代码(rapidxml.hpp:419+451):
419: void *memory = allocate_aligned(sizeof(xml_attribute<Ch>));
420: xml_attribute<Ch> *attribute = new(memory) xml_attribute<Ch>;
编译器会说
rapidxml.hpp(420):错误 C2061:语法错误:标识符“内存”
我有点明白这会如何混淆编译器。它实际上也让我很困惑。在那里做的(memory)部分是new(memory) xml_attribute<Ch>什么?
如果我删除那(memory)部分,它编译就好了。
此外,gcc 可以很好地编译它(memory)。
编辑:
哦,我超载new了DEBUG_NEW做一些内存调试。DEBUG_NEW不支持放置新。