共用方式為


編譯器錯誤 C3155

屬性索引子中不得使用屬性

索引屬性未正確宣告。 如需詳細資訊,請參閱 如何:在 C++/CLI 中使用屬性。

範例

下列範例會產生 C3155。

// C3155.cpp
// compile with: /clr /c
using namespace System;
ref struct R {
   property int F[[ParamArray] int] {   // C3155
   // try the following line instead
   // property int F[ int] {   // OK
      int get(int i) {
         return 0;
      }
   }
};