par exemple
class Test {
private:
___int x;
___int y;
public:
___Test(): x(0), y(0){}
___Test(const Test& t): x(t.x), y(t.y){}
___~Test(){}
Test& operator+(const Test& t) {
___Test tmp;
___tmp.x = x + t.x;
___tmp.y = y + t.y;
___return tmp;
}
};
bien ici la variable tmp se trouve dans la pile, lorsqu'on sort de la fonction elle sera détruite!!
comment faire?