MPogoda

Untitled

Feb 27th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. template< typename T >
  4. void f( T a)
  5. {
  6.   std::cout << "1\n";
  7. }
  8.  
  9. template< typename T >
  10. void f( T* a)
  11. {
  12.   std::cout << "2\n";
  13. }
  14.  
  15. template<>
  16. void f< int* > ( int* a)
  17. {
  18.   std::cout << "3\n";
  19. }
  20.  
  21.  
  22. int main(int argc, char const *argv[])
  23. {
  24.   int* pb;
  25.   f(pb);
  26.   return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment