When I allocate a dynamic array in C++ (T * p = new T[n]
), I use delete [] p to free the allocated memory. Obviously, the system knows the array size (in order among other things to call n times T's destructor). This is discussed elsewhere. For instance How does delete[] “know” the size of the operand array?. This is implemenation details.
But why was it not decided to make this information available?
Thx