Skip to content

Instantly share code, notes, and snippets.

@timmaxw
Created January 11, 2012 23:11
Show Gist options
  • Save timmaxw/1597379 to your computer and use it in GitHub Desktop.
Save timmaxw/1597379 to your computer and use it in GitHub Desktop.
C++ puzzle 2
#include <iostream>
using namespace std;
template<class T>
struct B {
struct X {
T t;
};
};
template<class T>
void foo(typename B<T>::X &x) {
cout << "foo" << endl;
}
int main(void) {
B<int>::X x;
foo(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment