I am writing a template class that internally manages an array of this type. Like this:
template<typename T> class Example {
I was wondering if C ++ calls the destructor of each object in objects when I delete it through delete[] objects; .
I need to know this because the objects in my class do not contain reasonable values ββall the time, so destructors should not be called when they do not.
Also, I would like to know if destructors will be called if I declare a fixed-size array, for example T objects[100] , as part of Example<T> .
c ++ delete-operator
Mixthos
source share