分享方式:


編譯器錯誤 C3913

預設屬性必須編制索引

未正確定義預設屬性。

如需詳細資訊,請參閱 property

下列範例會產生 C3913:

// C3913.cpp
// compile with: /clr /c
ref struct X {
   property int default {   // C3913
   // try the following line instead
   // property int default[int] {
      int get(int) { return 0; }
      void set(int, int) {}
   }
};