编译器错误 C2779

“declaration”: 属性方法只能与非静态数据成员关联

property 扩展属性未正确应用于静态数据成员。

以下示例生成 C2779:

// C2779.cpp
struct A {
   static __declspec(property(put=PutProp))
   // try the following line instead
   __declspec(property(put=PutProp))
      int prop;   // C2779
   int PutProp(void);
};