Imagine I\'m writing some container template or something. And the time comes to specialize std::swap for it. As a good citizen, I\'ll enable ADL by doing somet
I think I would move it into a separate namespace
namespace tricks {
using std::swap;
template
void swap(T &t, U &u) noexcept(noexcept(swap(t, u)));
}
template
void swap(my_template& x, my_template& y)
noexcept(noexcept(tricks::swap(std::declval(), std::declval())))
{
using std::swap;
swap(x.something_that_is_a_T, y.something_that_is_a_T);
}
Alternatively you can move the whole code up into tricks and delegate to there.