编译器错误 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 {};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈