我对TLS 1.0
rfc:
考虑以下结构:
enum { apple, orange } VariantTag;
struct {
select (VariantTag) { /* value of selector is implicit */
case apple: V1; /* VariantBody, tag = apple */
case orange: V2; /* VariantBody, tag = orange */
} variant_body; /* optional label on variant */
} VariantRecord;
TLS 1.0 RFC2246 4.6.1 Variants
说:
例如,
orange VariantRecord
是包含a的VariantRecord的缩小类型 variant_body类型V2。
但我们如何缩小以下结构:
enum { apple, orange } VariantTag;
enum { cherry, potato } AnotherTag;
struct {
select (VariantTag) {
case apple: V1;
case orange: V2;
} variant_body;
select (AnotherTag) {
case cherry: V3;
case potato: V4;
} another_body;
}
是否对variant_body
类型V2
和another_body
进行了类型`V4?