c2678错误

Searching…

learn.microsoft.com

编译器错误 C2678 | Microsoft Learn

注解 要使用该运算符,必须针对指定类型将其重载,或者定义一个到某个类型(该运算符已针对此类型进行了定义)的转换。 如果左操作数限定为常量,但运算符定义为采用非常量自变量,则会发生 C2678。

learn.microsoft.com

Compiler Error C2678 | Microsoft Learn

Aug 8, 2025 · Remarks 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. C2678 can occur when the left-hand operand is const-qualified ...