c++ - Koenig lookup for arguments -


is idea of koenig lookup arguments bad thing?

with adl have:

namespace foo {     struct bar {};     void baz(bar); }  baz(foo::bar()); 

and why don't have like:

namespace foo {   struct bar {};   void baz(bar); } // namespace foo  foo::baz(bar()); 

focusing on non-duplicate part, why not foo::baz(bar());? simple reason in c++, parse tree processed bottom top. name lookup of function name depends on function arguments, not other way around, overload resolution depends on argument types , not return type.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -