Classes and Structs (C++ Component Extensions)
Declares a class or struct whose object lifetime is administered automatically. When the object is no longer accessible or goes out of scope, Visual C++ automatically discards the memory that is allocated to the object.
Syntax
class_access ref class name modifier : inherit_access base_type {};
class_access ref struct name modifier : inherit_access base_type {};
class_access value class name modifier : inherit_access base_type {};
class_access value struct name modifier : inherit_access base_type {};
Parameters
Remarks
The default member accessibility of an object declared with ref class or value class is private. And the default member accessibility of an object declared with ref struct or value struct is public.
When a reference type inherits from another reference type, virtual functions in the base class must explicitly be overridden (with override (C++ Component Extensions)) or hidden (with new (new slot in vtable) (C++ Component Extensions)). The derived class functions must also be explicitly marked as virtual.
To detect at compile time whether a type is a ref class or ref struct, or a value class or value struct, use __is_ref_class (type), __is_value_class (type), or __is_simple_value_class (type). For more information, see Compiler Support for Type Traits (C++ Component Extensions).
For more information on classes and structs, see