我是 C++ 的新手,请考虑以下代码段:
class myClass
{
...
struct EntryKeyBase
{
void setOperation(OpType oper)
{
operation = oper;
}
OpType getOperation() const
{
return operation;
}
virtual void serialize(std::ostream& os) const = 0;
protected:
OpType operation;
};
struct ProtoEntryKey: EntryKeyBase
{
// some methods here
ProtoEntryKey(uint8_t l4proto) : proto(l4proto) // ???
{
operation = Inserted;
}
protected:
uint8_t proto;
};
// here more structs defined...
public:
...
};
标的线是什么???做?我知道我们声明了从 EntryKeyBase 继承的结构,但是后面的任何内容 ':' 我不明白,这个语法的真正含义是什么?谢谢!