Closed
Description
This is a cosmetic proposal since the C# compiler enforces blittable constraints and indicate errors where applicable (for example with stackalloc).
The idea is to allow something like:
public unmanaged struct MyBlittable
{
... no reference-type fields allowed ...
}
By explicitly declaring a struct as "unmanaged" you are making clear your intention, which can be useful for code comprehension and maintenance. So, if someone on your team (or even your-self after a while) is about to modify the code in the struct, that person will know that, for some reason, no reference type fields where allowed on such struct.
Metadata
Metadata
Assignees
Labels
No labels