Normally we could consider fixing this by providing a partial template
specialization of std::swap for Eigen types, but the big problem is
that std::swap takes only 1 template parameter and expects both sides
to be of the same type, and this is not always the case with Eigen
swap on expressions. We could still catch the case where both sides
have the same type, but I'm not sure what to do then. If we let that
work, it's awkward that we require both sides to have the same type in
std::swap and not in .swap(). If we want to emit an error, it's hard
to do because of SFINAE (so generating an error there would simply
discard the specialization.). I have to read back the rules of SFINAE,
perhaps it will work to let our std::swap specialization call another
function from where we trigger an error...
Benoit

Look how boost::swap works, there is a simple trick to have your own
eigen::swap that behaves correctly

the main swap having *two* templates arguments make it more specialized
than the ADL found swap for type T1 and T2.
Then the using clause in the details::swap bring std::swap in the game
if and only if the proper swap can't be found by ADL.