Teilen über


Compilerfehler C3103

'Argument': wiederholtes benanntes Argument

Bemerkungen

Ein Attribut kann benannte Argumente nicht wiederholen.

Weitere Informationen finden Sie unter User-Defined Attributes.

Beispiel

Im folgenden Beispiel wird C3103 generiert.

// 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 {};