c++ - I need some clarification regarding this example on Stroustrup's new book about ADL -
i reproduce below argument-dependent lookup (adl) example given in pages 396 , 397 of stroustrup book (4th edition): namespace n { struct s { int i; }; void f(s); void g(s); void h(int); }; struct base { void f(n::s); }; struct d : base { void mf(n::s); void g(n::s x) { f(x); // call base::f() mf(x); // call d::mf() h(1); // error: no h(int) available } }; what comments above correct (i've tested it), doesn't seem agree author says in next paragraph: in standard, rules argument-dependent lookup phrased in terms of associated namespaces (iso §3.4.2). basically: if argument class member , associated namespaces class (including base classes) , class's enclosing namespaces. if argument member of namespace, associated namespaces enclosing namespaces. if argument built-in type, there no associated namespaces. in example, x , has type n::s not member of class d , nor of base...