<分区>
这是我的代码的一部分: .h 文件中的声明:
virtual bool operator==(const File& file) const = 0;
在 .cpp 文件中
bool File::operator==(const File& file) const {
return true;
}
我得到这个编译错误:
1>c:\users\talw\desktop\hw5\hw5\project1\main.cpp(76): error C2259:
'Directory' : cannot instantiate abstract class
1> due to following members:
1> 'bool File::operator ==(const File &) const' : is abstract
1> c:\users\talw\desktop\hw5\hw5\project1\file.h(57) : see
declaration of 'File::operator =='
请帮忙。 谢谢