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.