我有一个名为 Restaurant 的类,其中包含一个 Employee 成员。现在 Employee 是 Restaurant 的朋友班。当我尝试编译它时,我在 Employee mCurrentEmployee 上收到错误,说它缺少类型说明符 - 假定为 int。为什么编译器会为此生我的气?关于如何修复它的任何想法?谢谢。
#pragma once
#include "employee.h"
class Restaurant{
friend class Employee;
private:
Employee mCurrentEmployee;
};
-
#pragma once
#include "restaurant.h"
class Employee {
}