-
Notifications
You must be signed in to change notification settings - Fork 6k
C# 8.0: unmanaged constructed types #14198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# 8.0: unmanaged constructed types #14198
Conversation
This is a great start @pkulikov There's a couple scenarios that we should cover, but it may require a slightly different sample. For discussion, I'll use the We should explain that if the type argument is not an unmanaged type, the constructed type is not unmanaged: var objCoords = new Coords<object>(); That's a contrived example, but you see the point. It is also interesting that adding the public struct Coords<T> where T : unmanaged
~
public T X;
public T Y;
} Thoughts on how to update to make those two points? |
I understand what you mean, but wording should be different. Type argument can be a reference type. Not practical example: public struct Coords<T>
{
public int X;
public int Y;
} With that definition, I'll think how to update the article. |
@BillWagner please take a look at the latest commit; I've also added one more snippet to the sample PR. |
ok, I think the current edition is final. What do you think @BillWagner? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work again @pkulikov
I had one small grammar nit to consider, and then I'll
docs/csharp/language-reference/builtin-types/unmanaged-types.md
Outdated
Show resolved
Hide resolved
Co-Authored-By: Bill Wagner <[email protected]>
Fixes #14101
Supported by dotnet/samples#1411