C6503
更新:2007 年 11 月
警告 C6503:批注冲突: 引用不可标记为 Null=Yes 或 Null=Maybe
此警告意味着错误地对引用类型使用了 Null 属性。引用用来存放对象的地址并且必须指向有效的对象。因为引用类型不能为 null,所以必须通过以下方法更正此错误:移除 Null 属性或将 Null 属性值设置为 No。
示例
下面的代码生成此警告:
// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
class Point
{
public:
// members
};
void f([Pre(Null=Yes)] Point& pt);
若要更正此警告,请将 Null 属性设置为 No,如下面的代码所示:
// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
class Point
{
public:
// members
};
void f([Pre(Null=No)] Point& pt);