Re: [Dev-C++] STL stack/vector pushing class objects
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Michal M. <mol...@se...> - 2003-10-25 18:21:53
|
Matt Kerr wrote: > stack<board> moves; > > if you do something like: > > moves.push( thismove ); > > Does thismove get copied or is it passed into the stack by reference? copied > In other words, if I am dynamically allocating thismove, should I be > worrying about deallocating (freeing) it at a later point? yes, you should take a look at smart pointers for solution http://boost.org/libs/smart_ptr/smart_ptr.htm |