编译器错误 C3065

不允许在非类范围上声明属性

在类的外部使用了 property __declspec 修饰符。 只能在类内部声明属性。

以下示例生成 C3065:

// C3065.cpp
// compile with: /c
__declspec(property(get=get_i)) int i;   // C3065

class x {
public:
   __declspec(property(get=get_i)) int i;   // OK
};