I figured I’d write a short but sweet blog entry that is bound to help someone. In a nutshell, I was using the parallel_for_each function in PPL and Visual Studio 2010 gave me the following error message:

error C2440: '=' : cannot convert from 'const std::pair<_Ty1,_Ty2> *' to 'std::pair<_Ty1,_Ty2>

It turns out that there are changes to PPL in Service Pack 1 of Visual Studio 2010, and if you do not have SP1 installed, then you can run into this error. Fixing it is as simple as getting SP1 on your machine.

To check whether you have SP1 installed, do the following:

  • Go to Help > About Microsoft Visual Studio
  • Look at your version of Visual Studio (it is the one on the LEFT)
  • If you do not see “SP1” anywhere in the version, then you don’t have service pack 1

You can download Service Pack 1 at here.

Happy coding.