2 // GROUPS passed operators
6 // ffrees space allocated for N-D array
10 void ffree(long rows, T** array)
12 for( long i = 0; i < rows; i++ )
13 delete [] array[i]; // delete row
14 delete [] array; // delete outer array
18 T* allocate1d(long size, T*& array)
20 return array = new T[size];
24 T** allocate2d(long d1, long d2, T**& array)
26 if( allocate1d(d1, array) != 0 )
28 for( long i = 0; i < d1; i++ )
30 if( allocate1d(d2, array[i]) == 0 )
46 foo() {std::cout << "foo created" << std::endl; }
48 ~foo() {std::cout << "foo deleted" << std::endl; }
52 allocate2d(d1, d2, f2);// { dg-error "" "" { target { ! c++11 } } }
53 ffree(d1, f2);// { dg-error "" "" { target { ! c++11 } } }