If Coll
is a standard container type, a
and b
are instances of Coll
; then, should we ALWAYS use std::swap(a, b)
instead of a.swap(b)
?
For me, std::swap(a, b)
is more generic than a.swap(b)
. However, I just wonder, can this be a best practice? or any counter example?