2

How to extend fields from a common struct to avoid code repetition. Suppose the common struct has a lot of fields and the extending struct has only some extra fields. Eg .

struct CommonStruct {
  field_1:i32,
  field_2:i32,
  ...
  field_10:i32
}

struct ExtendedStruct1 {
  field_11:i32
}

struct ExtendedStruct2 {
  field_12:i32
}
shadowfox
  • 581
  • 1
  • 7
  • 20

0 Answers0