I find vector::at() useful for alerting against out-of-bounds bugs while debugging, but it's painfully slow and unsuited for release code. Is there a known compiler flag or some method to automatically convert vector::at() to vector::operator[] when compiling in release mode, sort of like how asserts() are stripped in release with DNDEBUG?
Edit: Follow the linked question for a solution to this, or check the accepted answer (+ the comments below this question for some compiler specific stuff). Basically, this problem can be solved in reverse (there are options to allow bounds checking for vector::operator[] in debug mode).