0
编译我的三个文件的程序(main.cpp中,source.cpp,header.hpp)产生这些错误:编译器不会让我在头文件返回rapidxml :: xml_document,并报告错误
source.cpp: In member function ‘rapidxml::xml_document<> MyClass::generate_xml_document()’:
source.cpp:559:9: error: use of deleted function ‘rapidxml::xml_document<>::xml_document(const rapidxml::xml_document<>&)’
In file included from header.hpp:12:0,
from source.cpp:11:
rapidxml.hpp:1358:11: error: ‘rapidxml::xml_document<>::xml_document(const rapidxml::xml_document<>&)’ is implicitly deleted because the default definition would be ill-formed:
rapidxml.hpp:1322:9: error: ‘rapidxml::xml_node<Ch>::xml_node(const rapidxml::xml_node<Ch>&) [with Ch = char, rapidxml::xml_node<Ch> = rapidxml::xml_node<char>]’ is private
命名的线路有:
- source.cpp:559个状态根本
return doc;
。函数的结尾会生成rapidxml::xml_document<>
。 - header.hpp:12和source.cpp:11状态
#include "rapidxml.hpp"
。 周围rapidxml.hpp面积:1322状态:
private: // Restrictions // No copying xml_node(const xml_node &); void operator =(const xml_node &);
- rapidxml.hpp:1358是类
xml_document
的开头:class xml_document: public xml_node<Ch>, public memory_pool<Ch>
这是rapidxml错了吗? (我很确定它不是,因为Marcin Kalicinski肯定比我更好的程序员)。
我不知道rapidxml,但是说你不能复制它。你需要通过引用或指针传递它 – 2014-08-29 02:58:26