Attributes by Usage

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

This topic lists attributes according to the C++ language elements to which they apply.

If an attribute precedes a Visual C++ element that is not in the attribute's scope, the attribute block is treated as a comment.

AttributeDescription
Module AttributesApplies to the module attribute.
Interface AttributesApplies to the __interface C++ keyword.
Class AttributesApplies to the C++ keyword.
Method AttributesApplies to the methods in a class, coclass, or interface.
Parameter AttributesApplies to parameters of a method in a class or interface.
Data Member AttributesApplies to the data members in a class, coclass, or interface.
Typedef, Enum, Union, and Struct AttributesApplies to the C++ keywords.
Array AttributesApplies to arrays or SAFEARRAYs.
Stand-Alone AttributesOperates more like a line of code but does not operate on a C++ keyword. Stand-alone attribute statements require a semicolon at the end of the line.
Custom AttributesAllows the user to extend metadata.

C++ Attributes Reference
Concepts
Attributes by Group
Attributes Alphabetical Reference

Show: