編譯器錯誤 C3675
'function' : 已保留,因為已定義 'property'
當您宣告簡單屬性時,編譯程式會產生 get 和 set 存取子方法,而這些名稱會存在於程式的範圍內。 編譯程式產生的名稱是由屬性名稱前面加上get_和set_來形成。 因此,您無法宣告與編譯程式產生的存取子同名的函式。
如需詳細資訊,請參閱 property 。
範例
下列範例會產生 C3675。
// C3675.cpp
// compile with: /clr /c
ref struct C {
public:
property int Size;
int get_Size() { return 0; } // C3675
};