Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int f() { return 2;}
- double f() { return 2.7;}
- #include <cstdio>
- template <typename typed> typed f() { return 2.7; }
- int main(void) { return !printf("%d %f", f<int>(), f<double>()); }
- #include <cstdio>
- template <typename typed> typed f() { return f<void>(); }
- template <> int f() { return 2; }
- template <> double f() { return 2.7; }
- int main(void) { return !printf("%d %f", f<int>(), f<double>()); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement