Are .net Enums blittable types? (Marshalling)

前端 未结 3 1714
名媛妹妹
名媛妹妹 2021-01-03 02:18

Apparently there\'s a list of blittable types and so far I don\'t see Enums specifically on it. Are they blittable in general? Or does it depend on whether they are declared

3条回答
  •  独厮守ぢ
    2021-01-03 02:58

    Enums are blittable types. From the enum keyword documentation:

    Every enumeration type has an underlying type, which can be any integral type except char.

    Because the underlying type is integral (all of which are on the list of blittable types), the enum is also blittable.

提交回复
热议问题