VC9 SP1 Hotfix For The vector<function<FT>> Crash

Visual CPP Team

Back in August, I blogged about the TR1 fixes in VC9 SP1.  An observant reader, grokbrsm, commented that vector<function<FT>> was broken by VC9 SP1.  A hotfix for this bug is now available:


Here is the updated link to download the hotfix:;wa=wsignin1.0

This hotfix actually fixes 5 bugs:


1. function<FT>::swap() was broken by the Small Functor Optimization in VC9 TR1 (the Feature Pack).  This broke vector<function<FT>> in VC9 SP1.  “Broken” meant “compiling but crashing”.


2. vector<pair<X, string>> nonconformantly required X to have a default constructor.  (This is a specific example of a general bug: vector<pair<string, X>>, vector<pair<X, vector<int>>>, etc. were also affected.)


3. vector<tuple<X, Y, string>> nonconformantly required X and Y to have default constructors.  (This is a specific example of a general bug, see above.)


4. vector<array<X, N>> nonconformantly required X to have a default constructor.


5. Random distributions were broken, triggering infinite loops and emitting bogus results.


If you have any questions, I’ll be happy to answer them in the Comments.


Stephan T. Lavavej

Visual C++ Libraries Developer

Posted in C++


Discussion is closed.

Feedback usabilla icon