Compartir a través de


Error del compilador C3103

'argumento': argumento con nombre repetido

Un atributo no puede repetir argumentos con nombre.

Para obtener más información, consulte User-Defined Attributes.

Ejemplo

El ejemplo siguiente genera el error 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 {};