नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'property' : a property cannot be initialized
Remarks
A property cannot be initialized, for example, in a constructor's initialization list.
Example
The following example generates C3137:
// C3137.cpp
// compile with: /clr /c
ref class CMyClass {
public:
property int Size {
int get() {
return 0;
}
void set( int i ) {}
}
CMyClass() : Size( 1 ) { // C3137
// to resolve this C3137, remove the initializer from the
// ctor declaration and perform the assignment as follows
// Size = 1;
}
};