Guest User

Untitled

a guest
Nov 25th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. template <class T1, class T2>
  2. void function(T1 a, T1 b, T2 c) { ... }
  3.  
  4. template <class T1, class T2>
  5. void function(T1 a, T1 b, T2 c = С) { ... }
  6.  
  7. template<typename T, typename U = int>
  8. void f(T a, T b, U c = U(0))
  9. {
  10. cout << a << " " << b << endl;
  11. cout << typeid(c).name() << endl;
  12. cout << c << endl;
  13.  
  14. }
  15.  
  16. int main()
  17. {
  18. f(0,1,3);
  19. f(0,1,3.0);
  20. f(0,1);
  21. }
  22.  
  23. template <class T1, class T2>
  24. void function(T1 a, T1 b, T2 c)
  25. {
  26. ...
  27. }
  28.  
  29. template <class T1>
  30. void function(T1 a, T1 b)
  31. {
  32. function(a, b, C);
  33. }
Add Comment
Please, Sign In to add comment