共用方式為


編譯器錯誤 C2776

每個屬性只可以指定一個 'get' 方法

您只能在屬性擴充屬性中指定一個get函式。 指定多個 get 函式時,就會發生此錯誤。

下列範例會產生 C2776:

// C2776.cpp
struct A {
   __declspec(property(get=GetProp,get=GetPropToo))
   // try the following line instead
   // __declspec(property(get=GetProp))
      int prop;   // C2776
   int GetProp(void);
   int GetPropToo(void);
};