नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'instance_dereference_operator' : the meaning of dereferencing a handle can change, when a user-defined 'operator' operator exists; write the operator as a static function to be explicit about the operand
Remarks
When you add a user-defined instance override of the dereference operator in a managed type, you potentially override the ability of the type's dereference operator to return the handle's object. Consider writing a static, user-defined dereference operator.
For more information, see Handle to Object Operator (^) and Tracking Reference Operator.
Also, an instance operator is not available to other language compilers via referenced metadata. For more information, see User-Defined Operators (C++/CLI).
Example
The following example generates C4383.
// C4383.cpp
// compile with: /clr /W1
ref struct S {
int operator*() { return 0; } // C4383
};
ref struct T {
static int operator*(T%) { return 0; }
};
int main() {
S s;
S^ pS = %s;
T t;
T^ pT = %t;
T% rT = *pT;
}