Recently, I've been trying to restore C++ STL std::vector in Arduino Programs. However, I encountered a problem: If the T-class in the template is vector itself, like
vector<vector<int> > vec;
an error will occur if I try to destruct the instance of my vector class using destructor like
~vector(){free(__array_pointer/*this is declared in private section, whose type is T* */);}
So, I think I can solve it by using try&catch block to try to destruct each element in the vector, and just free the __array_pointer space if its elements are not pointer or container or without destructors. Then, what kind of exception does the delete operator throw if failed to execute?
By the way, will realloc() function throw exceptions and if yes, what kind of exceptions does it throw?
p.s. A noob developer, desperate for help. (T_T)