fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T1, typename T2 = T1>
  5. struct Tuple {
  6. T1 Item1;
  7. T2 Item2;
  8. };
  9. template<typename T>
  10. struct Tuple<T, T> {
  11. T Item;
  12. };
  13.  
  14.  
  15. int main() {
  16. // your code goes here
  17. Tuple<int, long> t1;
  18. cout << t1.Item1 << "," << t1.Item2 << endl;
  19. Tuple<float> t2;
  20. cout << t2.Item << endl;
  21. return 0;
  22. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
0,0
0