首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
时别专题
Effective C++:条款21:必须返回对象时别妄想返回其reference
(一) 一定要避免传递一些references去指向其实并不存在的对象。 看下面这个类: class Rational { public: Rational(int numerator = 0, int denominator = 1); private: int n, d; friend const Rational operator*(const Rational& lhs, c
阅读更多...