Value Types and Their Behaviors (C++/CLI)

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

Value types have changed in various ways from Managed Extensions for C++ to Visual C++. In this section, we look at the CLR enum type and the value class type, together with a look at boxing and access to the boxed instance on the CLR heap, as well as a look at interior and pinning pointers. There have been extensive language changes in this area.

CLR Enum Type
Discusses changes in the declaration and behavior of enums.

Implicit Boxing of Value Types
Discusses the motivation for implicit boxing of value types and the consequent changes in behavior.

A Tracking Handle to a Boxed Value
Discusses how implicit boxing of value types translates to a tracking handle to the boxed value object.

Value Type Semantics
Discusses changes to value type semantics, including inherited virtual methods, class default constructors, interior pointers, and pinning pointers.

C++/CLI Migration Primer
Classes and Structs

Show: