template static K some_template_func(int x) { return (K)x; } template struct Foo { template T method(K k) { return (T)k; } static T smethod() { return (T)10; } }; int main() { Foo f; return some_template_func(5) + Foo::smethod() + f.method(10); }