Starting with C++20, fully specializing a function template in the std namespace is undefined behavior. This precludes implementing swap for user-defined types in the standard namespace. You can find the reasoning in this paper.
I am running into this issue while using boost::sort in a project using C++20. I have implemented a free function swap for my type in the type's namespace, but since the library code is explicitly calling std::swap, it cannot find it. If I implement the free function in std, the compiler chooses to ignore it, which is allowed under the standard.
I changed the sort code to use the "use std::swap and then call swap unqualified" idiom, and everything worked as expected. For example:
std::swap(*iter1, *iter2);
becomes,
using std::swap;
swap(*iter1, *ite2);
I can submit a PR for this change if that is appropriate.