14 Jun
2006
14 Jun
'06
7:46 p.m.
Howard Hinnant wrote:
One also has to watch out for ADL in the namespaces of template arguments (another common accidental use of ADL). For example:
std::vector<N::MyClass, M::MyAllocator> v;
foo(v); // searches std, N, M
One common problem of this kind is template< class T, class A = std::allocator<T> > class X; X<int> x; foo( x ); // searches std