Sign in to follow this  
  • entries
    56
  • comments
    80
  • views
    41679

Microsoft's STL implementation slow? - 2

Sign in to follow this  

276 views

Thanks everyone, I've received a lot of helpful comments and I was able to solve the problem.

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.
Sign in to follow this  


1 Comment


Recommended Comments

Yeah, I agree. I'd far rather have it controlled by the _DEBUG define. I was under the impression that this is why we have a std::vector<>::at() method as well as an operator[].

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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now