编译器错误 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) {}
   }
};