fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. template<typename t1, typename t2, typename t3, typename t4>
  5. class Quadruple {
  6. public:
  7. t1 first;
  8. t2 second;
  9. t3 third;
  10. t4 fourth;
  11.  
  12. Quadruple(t1 a, t2 b, t3 c, t4 d) {
  13. first = a;
  14. second = b;
  15. third = c;
  16. fourth = d;
  17. }
  18.  
  19. void display() {
  20. cout << "First: " << first << endl;
  21. cout << "Second: " << second << endl;
  22. cout << "Third: " << third << endl;
  23. cout << "Fourth: " << fourth << endl;
  24. }
  25. };
  26.  
  27. int main() {
  28. Quadruple<int, string, double, char> q(10, "Nafees", 3.75, 'A');
  29.  
  30. q.display();
  31.  
  32. return 0;
  33. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
First: 10
Second: Nafees
Third: 3.75
Fourth: A