NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C3160

'pointer' : cannot declare interior gc pointer as a member of 'class'

Interior garbage collection (GC) pointers may point to the interior of a managed class. Because they are slower than whole-object pointers and require special handling by the garbage collector, you cannot declare GC pointers as members of a class.

The following sample generates C3160:

#using <mscorlib.dll>
int __gc* pg2; // OK

__gc struct A {
   // cannot create interior pointers inside a class
   int __gc* pg; // C3160
};
void main() {
}