--- mdhanakoti <[EMAIL PROTECTED]> wrote:
> > However, in my C++ version, there are 2 items (as
> I understand it) -
> > the local variable item, which is initialised and
> passed to
> > push_back() to create a copy of it in the list.
> 
> No. push_back function takes a reference argument
> and therefore no 
> copies are made.
> 
<snip>
> Regards,
> Murali.
> 
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.

Ray
Ray




 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

Reply via email to