C# Language Generic pointers


Example

The criteria that a type must satisfy in order to support pointers (see Remarks) cannot be expressed in terms of generic constraints. Therefore, any attempt to declare a pointer to a type provided through a generic type parameter will fail.

void P<T>(T obj) 
    where T : struct
{
    T* ptr = &obj; // compile-time error
}