Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

/vmm, /vms, /vmv (General Purpose Representation)

/Vmm
/Vms
/Vmv

If you select General-Purpose Always (/vmg) as the representation method, you must also specify an option to indicate the inheritance model of the not-yet-encountered class definition. You can select one of the following three options.

Option Description
/vmm
  • Specifies the most general representation of a pointer to a member of a class to be one that uses multiple inheritance.

    The corresponding inheritance keyword and argument to #pragma pointers_to_members is multiple_inheritance.

  • This representation is larger than that required for single inheritance.
  • If the inheritance model of a class definition for which a pointer to a member is declared is virtual, the compiler generates an error.
/vms
  • Specifies the most general representation of a pointer to a member of a class to be one that uses either no inheritance or single inheritance.

    The corresponding inheritance keyword and argument to #pragma pointers_to_members is single_inheritance.

  • This is the smallest possible representation of a pointer to a member of a class.
  • If the inheritance model of a class definition for which a pointer to a member is declared is multiple or virtual, the compiler generates an error.
/vmv
  • Specifies the most general representation of a pointer to a member of a class to be one that uses virtual inheritance.

    The corresponding inheritance keyword and argument to #pragma pointers_to_members is virtual_inheritance.

  • This option requires a larger pointer and additional code to interpret the pointer than the other options.
  • It never causes an error and is the default.

On the command line, use any one of these options with /vmg.

When you specify one of these inheritance-model options, that model is used for all pointers to class members, regardless of their inheritance type or whether the pointer is declared before or after the class.

Therefore, if you always use single-inheritance classes, you can reduce code size by compiling with /vms; however, if you want to use the most general case (at the expense of the largest data representation), compile with /vmv.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the Command Line property page.
  4. Type the compiler option in the Additional Options box.

To set this compiler option programmatically

See AdditionalOptions.

See Also

/vmb, /vmg (Representation Method) | Compiler Options | Setting Compiler Options

Show:
© 2014 Microsoft. All rights reserved.