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
|