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

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -