|
![](/i/fill.gif) |
Am 14.01.2014 22:21, schrieb Orchid Win7 v1:
> OK, so we have a std::vector of pointers to task objects. How do we swap
> a pair of elements to change their order?
>
> Half the Internet claims this is std::swap(), the other half claim it's
> std::swap_iter(), and a few people claim it's something else again...
From the names of those function, I'd suspect both to be right:
std::swap_iter() probably works on arbitrary containers but requires you
to obtain an iterator first, while std::swap() might just need numeric
indices but be limited to std::vector.
Post a reply to this message
|
![](/i/fill.gif) |