fork download
  1. struct A
  2. {
  3. char *buf;
  4. A(int size) : buf(new char[size]) {}
  5. ~A() { delete [] buf; }
  6. };
  7.  
  8. template <typename T, int val> struct with_arg : T
  9. {
  10. with_arg() : T(val) {}
  11. };
  12.  
  13. int main()
  14. {
  15. A *a = new with_arg <A, 10> [10];
  16. delete [] a;
  17. return 0;
  18. }
Success #stdin #stdout 0s 4276KB
stdin
Standard input is empty
stdout
Standard output is empty