Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4.  
  5. /*int add(const int a, const int b) {
  6.     std::cout << "Xsadbd12uy4eb21u3b21yub";
  7.     return a + b;
  8. }
  9.  
  10. double add(const double a, const double b) {
  11.     std::cout << "Xsadbd12uy4eb21u3b21yub";
  12.     return a + b;
  13. }
  14.  
  15. char add(const char a, const char b) {
  16.     std::cout << "Xsadbd12uy4eb21u3b21yub";
  17.     return a + b;
  18. }*/
  19.  
  20. template <typename T>
  21. T add(const T a, const T b) {
  22.     std::cout << "Xsadbd12uy4eb21u3b21yub";
  23.     return a + b;
  24. }
  25.  
  26. int main() {
  27.     std::cout << add(2, 5) << '\n'
  28.               << add(2.6, 5.4) << '\n';
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement