Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DEBUG
- #include <vector>
- template<typename T, typename A = std::allocator<T> > class SafeVector : public std::vector<T, A> {
- public:
- typename std::vector<T, A>::reference
- operator[](typename std::vector<T, A>::size_type n) {
- return at(n);
- }
- typename std::vector<T, A>::const_reference
- operator[](typename std::vector<T, A>::size_type n) const {
- return at(n);
- }
- };
- using namespace std;
- #ifdef DEBUG
- #define vector SafeVector
- #endif
Advertisement
Add Comment
Please, Sign In to add comment