Afficher un message
Vieux 03/04/2008, 13h59   #2
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Again a simple question about std::vector

ciccio wrote:
> Again I am wondering about something.
>
> If you use the swap function of an std::vector, what does it do?
>
> Does it swap each element separately by means of copying to a tmp
> variable, or does it just swap some pointers to memory blocks.


In most implementations, the latter. Of course it also has to
swap the size if it's cached (and it probably is), and other data
members.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  Réponse avec citation
 
Page generated in 0,08625 seconds with 9 queries