At 13:44 2007-02-02, mdhanakoti wrote:
> > Yes, push_back takes a reference so that the item is
> > not copied to get it to the function, but push_back
> > makes a copy to add to the list (or other container).
> > By push_back taking a reference only one copy is made
> > instead of two.
>
>How about creating a std::vector<Item*>. That gets rid of the need to
>make copies all together.

it does and has problems of it's own
you have to leave the item "in scope" until you're finished with the 
vector otherwise the pointer is meaningless.
also, you are then responsible for getting rid of the data later.
why would you want to do that??


>Murali.
>
>
>
>To unsubscribe, send a blank message to 
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>

Victor A. Wagner Jr.      http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law" 

Reply via email to