Skip to content
Discussion options

You must be logged in to vote

Before C# 11, it was an error for a pointer to point to a managed type in all circumstances. In C# 11, most of the errors were turned into warnings. See the associated proposal:

Pointer types are extended to allow managed types as referent type. Such pointer types are written as a managed type followed by a * token. They produce a warning.

The address-of operator is relaxed to accept a variable with a managed type as its operand.

The fixed statement is relaxed to accept fixed_pointer_initializer that is the address of a variable of managed type T or that is an expression of an array_type with elements of a managed type T.

The error is still used where managed types are strictly disallow…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Joe4evr
Comment options

Answer selected by JJLovesLife
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants