共用方式為


編譯器錯誤 C3103

'argument': 重複的具名自變數

屬性無法重複具名自變數。

如需詳細資訊,請參閱 User-Defined Attributes

範例

下列範例會產生 C3103。

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

[AttributeUsage(AttributeTargets::All)]
public ref class Attr : public Attribute {
public:
   int m_t;
};

[Attr(m_t = 10, m_t = 1)]   // C3103
// try the following line instead
// [Attr(m_t = 10)]
ref class A {};