LessonInterface
class ILesson
{
public:
virtual void PrintLessonName() = 0;
virtual ~ILesson() {}
};
Run Code Online (Sandbox Code Playgroud)
stl容器
typedef list<ILesson> TLessonList;
Run Code Online (Sandbox Code Playgroud)
调用代码
for (TLessonList::const_iterator i = lessons.begin(); i != lessons.end(); i++)
{
i->PrintLessonName();
}
Run Code Online (Sandbox Code Playgroud)
错误:
描述资源路径位置类型将'const ILesson'作为'this'参数传递给'virtual void ILesson :: PrintLessonName()',丢弃限定符
c++ ×1