fork download
  1. #include <iostream>
  2.  
  3. class cArguments
  4. {
  5. public:
  6.  
  7. cArguments(int,int,int) {}
  8. int getA(){return 0;}
  9. int getB(){return 0;}
  10. int getX(){return 0;}
  11.  
  12. };
  13.  
  14. template <typename T>
  15. class cFunction {
  16. public:
  17. cFunction(){}
  18. cFunction(cArguments* args, int _n);
  19. T getFunc(int num);
  20. private:
  21. T* func;
  22. };
  23.  
  24. template <typename T>
  25. cFunction<T>::cFunction(cArguments* args, int _n)
  26. {
  27. for(int i = 0; i < _n; i++) {
  28. /*func[i] =*/ new T(args->getA(), args->getB(), args->getX());
  29. }
  30. }
  31.  
  32. using namespace std;
  33.  
  34. int main() {
  35.  
  36. cArguments arg(10,10,10);
  37.  
  38. cFunction<cArguments> a(&arg, 10);
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0.02s 2808KB
stdin
Standard input is empty
stdout
Standard output is empty