I keep reading that swap() operation, like this for example:
template<class T>
void swap (T &a, T &b)
{
T temp (a);
a = b;
b = temp;
}
is problematic when we are dealing with Exception-safety.
What's so wrong with it? Furthermore, how can we solve it?