Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
unary 'operator' : 'type' does not define this operator or a conversion to a type acceptable to the predefined operator
Remarks
C2675 can also occur when using a unary operator, and the type does not define the operator or a conversion to a type acceptable to the predefined operator. To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.
Example
The following example generates C2675.
// C2675.cpp
struct C {
C(){}
} c;
struct D {
D(){}
void operator-(){}
} d;
int main() {
-c; // C2675
-d; // OK
}