Apparently, regardless of whether you're in release mode or not, Microsoft's vectors do some 'other' stuff in the background.
So, in order to fix this issue you have to use these pre-processor definitions:
#define _CRT_SECURE_NO_WARNINGS#define _SCL_SECURE_NO_WARNINGS#define _SECURE_SCL 0#define _HAS_ITERATOR_DEBUGGING 0
I still think it's a bit silly that they assume you want iterator checking, etc on but w/e.
It's also a pain if you are writing libs, since I'd assume all the different parts of a solution have to be compiled with the same flags to prevent stuff exploding.
I guess it's to do with Microsoft encouraging more security-robust code.