且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试引用已删除的函数(VS2013)

更新时间:2023-12-02 19:11:46

发生错误是因为您有一个 std::ifstream 数据成员,而您可能正试图复制一个 Board 某处,或者有一些需要复制构造函数才能访问的代码.

The error happens because you have an std::ifstream data member, and you are probably trying to copy a Board somewhere, or have some code that requires the copy constructor to be accessible.

std::ifstream boardFile;

Board 编译器提供的复制构造函数尝试复制流,但该流不可复制.所以你要么提供你自己的复制构造函数来做一些聪明的事情,要么删除需要 Board 复制构造函数的代码.

The Board compiler-provided copy constructor tries to copy the stream, but the stream is not copyable. So you have to either provide your own copy constructor to do something clever, or remove code that requires the Board copy constructor.