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 C2847

cannot apply sizeof to managed class, interface or value type 'class'

The sizeof operator gets the value of an object at compile time. The size of a managed class, interface, or value type is dynamic and so cannot be known at compile time.

The following sample generates C2847:

#using <mscorlib.dll>
__gc class A {
};

void main() {
   A *xA = new A;
   sizeof(xA);   // cannot use sizeof on managed object
}