Could someone please explain why the following code is giving error (error C2065: 'select' : undeclared identifier) at compile time:
namespace N { class MyClass{ }; template<int I> void select(MyClass*) {} } void g (N::MyClass* mp) { select<10>(mp); } void main() {} According to Argument Dependent Lookup, this should work fine, since I have specified N:: in `g``s argument. So, select should be visible to compiler.
Why does ADL not work here?
int main()orint main(int argc, char* argv[]), even if you do notreturnanything (in which case it is the same as returning0)mainshould returnintbecause that's the only portable return type specified by the language standard. Your compiler allows non-standard extensions, but most others don't. Posting non-standard code here makes the question harder to answer.