标签:return code com opera -- operator int tor span
前置++与后置++运算符重载,前置--与后置--运算符同理
complex& operator++(complex& c1) { c1.a++; c1.b++; return c1; } complex& operator++(complex& c1, int)//占位符区分前置还是后置 { complex temp = c1; c1.a++; c1.b++; return temp; }
标签:return code com opera -- operator int tor span
原文地址:https://www.cnblogs.com/jly594761082/p/10584155.html