Last active
August 29, 2015 14:14
-
-
Save dgodfrey206/430779cfe01004d7c50c to your computer and use it in GitHub Desktop.
ADL and function template instantiation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class T> | |
decltype(f(T())) h() {} | |
void f(int); | |
void f(struct X); | |
struct X {}; | |
int main() | |
{ | |
h<int>(); // fundamental types have no associated namespaces | |
h<X>(); // user-defined types have associated global namespace | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment