本节探究 return-by-reference 和 return by object的区别
做法:
写一个class,调用 operator +,来探究其 ctor、dtor
结论:
Entity& : return by reference 不会在 + 的过程中调用 ctor、dtor
Entity : return by value 会在+ 的过程中调用 copy ctor、dtor
#include <iostream>
class Entity{
public:
Entity( int x, int y ) : _x(x), _y(y){
std::cout << "ctor" <<