想象一下,我正在写一些容器模板或其他东西.现在是时候专注std::swap于它了.作为一个好公民,我会通过这样的方式启用ADL:
template <typename T>
void swap(my_template<T>& x, my_template<T>& y) {
    using std::swap;
    swap(x.something_that_is_a_T, y.something_that_is_a_T);
}
这非常整洁.直到我想添加一个异常规范.我swap是noexcept只要调换T的noexcept.所以,我会写一些类似的东西:
template <typename T>
void swap(my_template<T>& x, my_template<T>& y)
    noexcept(noexcept(swap(std::declval<T>(), std::declval<T>())))
问题是,swap在那里需要ADL发现swap或std::swap.我该如何处理?