// 1
struct Base
{
int retCode {};
std::string retErrorString;
};
// 2
template <typename Type>
struct EventResult : Base
{
Type retValue {};
};
// 3
template <>
struct EventResult<void> : Base {};
代码段 1 中间的 int retCode 后面为什么要添加一对{},代码 2 也有类似的,Type retValue {} 代码段 2 已经定义好了模板,为什么要添加代码段 3 ?