嘿,我的课程有问题。它应该有一个返回相同类但具有其他私有构造函数的方法。但它因特定错误而失败:
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' :
cannot access private member declared in class '
这是头文件:
class XMLClass {
private:
bool isGood();
std::vector<std::string> xmlRowList;
std::fstream xmlFS;
XMLClass(std::string newList);
public:
XMLClass(char *filename,std::string root);
std::string getAttribute(char *att);
std::string getText(void);
XMLClass getChildNode(std::string childNode);
};
这是导致错误的方法:
XMLClass XMLClass::getChildNode(std::string Node)
{
XMLClass newXML(Node);
return newXML;
}