Hi , There:
I just have a simple question by programming.
Looks like this:
class A{
.....
.....
Public:
copy(){
return *(this);
}
}
in .cc file: for example we have a container
list<A> list;
A* a = new A(...);
list.push_back(a->copy());
Why is this copy() better than not use it .
I guess, if we use this copy(), then needn't to free this pointer.
But really don't know ,why ......
Any suggestion will be appreciated .
Thx
Teddy