fork download
  1. #include <iostream>
  2. #include <list>
  3.  
  4. template <class T1, class T2>
  5. class FirstClass
  6. {
  7. public:
  8. FirstClass (T1 & a, T2 & b);
  9. };
  10.  
  11. template <class T1, class T2, class T3>
  12. class SecondClass
  13. {
  14. public:
  15. SecondClass (T1 & a, T2 & b, T3 & c);
  16. };
  17.  
  18. template<class T1, class T2, class T3 = FirstClass<T1, T2>>
  19. class FirstPool
  20. {
  21. std::list <T3> Objects;
  22. T1 aa;
  23. T2 bb;
  24.  
  25. public:
  26. FirstPool (T1 & a, T2 & b) : aa (a), bb (b) {}
  27. };
  28.  
  29. template<class T1, class T2, class T3>
  30. class SecondPool : FirstPool<T1, T2, SecondClass<T1, T2, T3>>
  31. {
  32.  
  33. T3 cc;
  34.  
  35. public:
  36. SecondPool (T1 & a, T2 & b, T3 & c)
  37. : FirstPool<T1, T2, SecondClass<T1, T2, T3>>(a, b)
  38. , cc (c)
  39. {}
  40. };
  41.  
  42.  
  43. int main() {
  44. // your code goes here
  45.  
  46. return 0;
  47. }
Success #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty