Redefinition of vector<T, Alloc>.

Supporting Design by Contract in C++
by David Maley and Ivor Spence
Listing 6. Redefinition of vector<T, Alloc>.

namespace stdpp {
template <class T, class Alloc = alloc>
class vector : public std::vector<T, Alloc>, public CoManager {
 virtual bool pre_erase(iterator) const { return true; }
 virtual bool post_erase(const vector<T>&, iterator) const { return true; }
 iterator erase(iterator);

About the Authors

David Maley is with St. Mary's University College, Belfast. He can be contacted at

Ivor Spence is with Queen's University of Belfast. He can be contacted at


Upcoming Events


Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.