If in a class method I pass in a list:
std::list< regmatch_t* >& pm_list;
and dynamically allocate memory for an array (of type regmatch_t) which is then added to the list as a pointer:
regmatch_t* pm = new regmatch_t[ num_subexpressions ];
pm_list.push_back( pm );
will the list destructor automatically deallocate the pointer/array, or will this become a memory leak for whomever uses this method without explicitly deallocating each regmatch_t* pointer?
Thanks!