नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : a trivial property cannot have reference type
Remarks
A property was declared incorrectly. When you declare a trivial property, the compiler creates a variable that the property will update, and it is not possible to have a tracking reference variable in a class.
See property and Tracking Reference Operator for more information.
Example
The following example generates C3290.
// C3290.cpp
// compile with: /clr /c
ref struct R {};
ref struct X {
R^ mr;
property R % y; // C3290
property R ^ x; // OK
// OK
property R% prop {
R% get() {
return *mr;
}
void set(R%) {}
}
};
int main() {
X x;
R% xp = x.prop;
}