编译器错误 C3296

“property”:已存在同名属性

编译器遇到具有相同名称的多个属性。 类型中的每个属性均必须具有唯一名称。

有关详细信息,请参阅 property

示例

以下示例生成 C3296。

// C3296.cpp
// compile with: /clr /c
using namespace System;

ref class R {
public:
   property int MyProp[int] { int get(int); }

   property String^ MyProp[int] { void set(int, String^); }   // C3296
};