I am trying to use Hinnant's short_alloc for allocating vectors on stack, I am trying to remove the heap allocation completely. Now comes the problem where the developer uses push_back beyond the vector size. I am thinking of overriding the push_back function such that it checks if the capacity is reached, if yes then it will assert the error. As it is understood that STL functions are not meant to be overridden, What will be the better approach to achieve.
Aucun commentaire:
Enregistrer un commentaire