Re: is an object deep-copied when added to a collection?
by Andrea Francia <andrea.francia@[EMAIL PROTECTED]
>
May 11, 2008 at 01:22 AM
Mark Space wrote:
> Vector<Date*> alist = Vector<Date*>();
>
> Date *d = new Date();
>
> alist.add(d);
>
> Or something like that, it's been a long time since C++.....
Your example is almost correct.
The only things that need to be corrected are the initialisation
and the name of the method which add an entry to the vector.
vector<Date *> alist; // default constructor called implicitly
Date *d = new Date;
alist.push_back(d);
Also I don't use c++ since long time ago, maybe I mistaked something else.
--
Andrea Francia
alias rm='trash' #use trash command instead of removing
rm -Rfv file #put the file in the KDE trashcan
http://www.andreafrancia.it/trash