Advertisement
Guest User

catskul

a guest
Oct 29th, 2009
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. template <typename Type>
  4. Type foo( Type arg )
  5. {
  6.     struct Bar
  7.     {
  8.         Type value;
  9.     };
  10.  
  11.     Bar var;
  12.     var.value = arg;
  13.  
  14.     return var.value;
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20.     printf( "Result is: %i\n", foo<int>(3) );
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement