sBar not a function, but a function template. Argument-dependent searches work only for function names. It is true that sBar<int> is a function, but you cannot create an instance of a template unless you know its own name!
Unbound, if the template argument can be inferred, this ADL works:
namespace ns { template <typename T> void sZip(T &) { } } void foo() { ns::S s; sZip(s);
The general "best practice" for C ++ is to create function templates only if the arguments can be inferred and never specify the arguments explicitly. (The exceptions to this rule are std::forward and various make_* functions, which require one required argument for the desired type of result.)
source share