我正在尝试在结构构造函数中设置一个枚举,但我无法完全正确地获取语法。有什么建议吗?这就是我所拥有的,但我不断收到错误。
struct Event{
enum eventType { Arrival, CPUburstCompletion, IOcompletion, TimerExpired }enumField;
double time; // Defined as time units since the start of the simulation
Event(eventType e, double theTime): enumField(e), time(theTime){}
};