not really... both ways are the same. std::swap just allows you to do a little bit of less typing.
The behavior of this function template is equivalent to:
1 2 3 4
template <class T> void swap ( T& a, T& b )
{
T c(a); a=b; b=c;
}
or
1 2 3 4 5 6 7 8 9
template <class T> void swap (T& a, T& b)
{
T c(std::move(a)); a=std::move(b); b=std::move(c);
}
template <class T, size_t N> void swap (T &a[N], T &b[N])
{
for (size_t i = 0; i<N; ++i) swap (a[i],b[i]);
}