Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic


The Access property specifies whether a value can be read from, written to, both, or neither. This property is allowed on Pre and Post attributes and can be applied to any data type.

The Access property must be set using one of the following values:

  • SA_NoAccess - the value may not be read from or written to.

  • SA_Read - the value may be read from, but not written to.

  • SA_Write - the value may be written to, but not read from.

  • SA_ReadWrite - the value may be read from and written to.

Note   By default, the Access property value is SA_ReadWrite. In addition, Access property value is inferred from the const qualifier as SA_Read.

The following code shows how to use the Access property:

// C 
#include <CodeAnalysis\SourceAnnotations.h>
void f ([SA_Pre(Access=SA_Read)] int x);

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f ([Pre(Access=Read)] int x);

In C++, it is optional to use SA_ prefix.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.