编译器错误 C3903
“property”: 没有 set 或 get 方法
属性必须至少具有 get
或 set
方法。 有关详细信息,请参阅 property。
以下示例生成 C3903:
// C3903.cpp
// compile with: /clr
ref class X {
property int P {
void f(int){}
// Add one or both of the following lines.
// void set(int){}
// int get(){return 0;}
}; // C3903
property double Q[,,,,] {
void f(){}
// Add one or both of the following lines.
// void set(int, char, int, char, double, double){}
// double get(int, char, int, char, double){return 1.1;}
} // C3903
};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈