Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- template <typename Type>
- Type foo( Type arg )
- {
- struct Bar
- {
- Type value;
- };
- Bar var;
- var.value = arg;
- return var.value;
- }
- int main()
- {
- printf( "Result is: %i\n", foo<int>(3) );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement