Rediger

Del via


/vmb, /vmg (Representation method)

Select the method that the compiler uses to represent pointers to class members.

Syntax

/vmb
/vmg

Options

/vmb is the compiler's default behavior. Its behavior is the same as #pragma pointers_to_members(best_case). It doesn't require or ensure complete types. For complete types, it uses the best representation among single, multiple, or virtual inheritance based the inheritance of the class type. For incomplete types, it uses the largest, most general representation.

/vmg lets you specify compiler behavior in combination with /vmm, /vms, /vmv (General purpose representation) to declare a pointer to a member of a class before defining the class. This need can arise if you define members in two different classes that reference each other. For such mutually referencing classes, one class must be referenced before it's defined.

Remarks

You can also use #pragma pointers_to_members or Inheritance keywords in your code to specify a pointer representation.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > C/C++ > Command Line property page.

  3. Enter the compiler option in the Additional Options box.

To set this compiler option programmatically

See also

MSVC compiler options
MSVC compiler command-line syntax