Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5.  
  6. template<typename T,int n>
  7. class klasa
  8. {
  9. T tab[n];
  10. public:
  11. klasa(){}
  12. T& operator[](int i)
  13. {
  14. return tab[i];
  15. }
  16.  
  17. template<typename M>
  18. void add(M liczba)
  19. {
  20. for(int i = 0 ; i<n;i++)
  21. tab[i]+=liczba;
  22. }
  23.  
  24. template<>
  25. void add(string a){}
  26.  
  27.  
  28. };
  29.  
  30.  
  31.  
  32. int main()
  33. {
  34.  
  35.  
  36. //cout << << endl;
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement