更新时间:2023-11-10 08:44:40
也许你必须从
运算符重载 - cppreference.com [ ^ ],
C ++中的运算符重载 - Cprogramming.com [ ^ ]。
在上面引用的最后一篇文章中,最接近你的案例是Complex类的代码示例;显示+运算符的实现。
Perhaps you have to start with
operator overloading — cppreference.com[^],
Operator Overloading in C++ - Cprogramming.com[^].
In last of the articles referenced above, the case closest to yours is the code sample of class "Complex"; implementation of + operator is shown.