1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// Build don't run: // GROUPS passed templates membertemplates extern "C" int printf(const char*, ...); struct S { template <class T> void foo(T); }; template <class T> void S::foo(T) { printf("Hello, world.\n"); } int main() { S s; s.foo(3); s.foo(s); }