Compiler Error C2394
'your_type::operator'op'" : CLR or WinRToperator not valid. At least one parameter must be of the following types: 'T^', 'T^%', 'T^&', where T = 'your_type'
An operator in a Windows Runtime or managed type did not have at least one parameter whose type is the same as the type of the operator return value.
The following sample generates C2394:
// C2394.cpp
// compile with: /clr /c
ref struct Y {
static Y^ operator -(int i, char c); // C2394
// OK
static Y^ operator -(Y^ hY, char c);
// or
static Y^ operator -(int i, Y^& rhY);
};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for