若为类MyClass重载运算符+,下列声明中错误的是?


若为类MyClass重载运算符+,下列声明中错误的是?

A.friend MyClass operator+(MyClass, MyClass)

B.friend MyClass operator+(MyClass, double)

C.friend MyClass operator+(double, MyClass)

D.friend MyClass operator+(double, double)

正确答案:friend MyClass operator+(double, double)


Tag:声明 时间:2024-01-14 10:43:21