Possible Duplicate:
GCC STL bound checking
Is there something like a automatic debug version of the std:vector in the g++ STL and if not how could I achive one?
What I want is to specify a debug parameter in my g++ call for example:
g++ -D DEBUG_ main.cpp
When this parameter is defined I want all my std::vectors to check their boundarys when accesing an element, the way when using vector::at().
When the parameter is omitted I want all vectors to behave as if the normal [] operator is used, meaning no performance is "wasted" for boundary checking.
I heard that VC++ does something like this. So my question is how to to this using the g++?