Does System.Runtime.InteropServices.LayoutKind.Sequential control the layout in managed memory for constructed types that only contain blittable types? #58322
-
The documentation of For example if I have the following type constructor: using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential)]
public readonly struct Maybe<TSome> where TSome: notnull {
readonly TSome _some;
readonly byte _flag;
} is the type I've tried creating many different type constructors with variable number of type parameters and constructing types from said type constructors, and the layout was always what I predicted it to be; however that obviously falls quite short of a mathematical proof. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As answered by @tannergooding here—which motivated this question to begin with—the answer is in the affirmative. |
Beta Was this translation helpful? Give feedback.
As answered by @tannergooding here—which motivated this question to begin with—the answer is in the affirmative.