I'm trying to make a class template swappable. I don't understand why the static assertion fails:
#include <type_traits>
template <class T>
struct A {};
template <class T, class U>
constexpr void
swap (A <T>&, A <U>&) {}
static_assert (std::is_swappable_v <A <int>>);
int main (){}
It passes with
template <class T>
constexpr void
swap (A<T>&, A<T>&) {}
but shouldn't the first one also be OK?
godbolt: https://godbolt.org/z/vbWWxrec4