fork download
  1. template <typename T, int N> class Group
  2. {
  3. public:
  4. T values[N];
  5.  
  6. Group(T args[])
  7. {
  8. for (int i = 0; i < N; i++)
  9. {
  10. values[i] = args[i];
  11. }
  12. }
  13.  
  14. Group()
  15. {
  16. this((T[]){0, 0, 0});
  17. }
  18. };
  19.  
  20. int main()
  21. {
  22. Group<double, 3> * v1 = new Group<double, 3>();
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘Group<T, N>::Group() [with T = double; int N = 3]’:
prog.cpp:22:50:   required from here
prog.cpp:16:17: error: expression cannot be used as a function
             this((T[]){0, 0, 0});
             ~~~~^~~~~~~~~~~~~~~~
stdout
Standard output is empty