Re: Is PGO (Profile Guided Optimization) incompatible with stl and /MD
"Phil Borghesani" <PhilBorghesani@discussions.microsoft.com> wrote in
message news:1E492258-B202-4231-AD9F-E90CFA213E97@microsoft.com
This code when built with default console options and Instrumented
with for Profile Guided Optimization will Abort with a forced error
from _invalid_parameter. If the code is built normaly (debug or
release) it is fine and if I switch to /MT then the problem goes
away. Switching my full application to /MT is NOT an option.
Phil
// CODE started with a default console application
#include "stdafx.h"
#include <string>
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
std::string ts("A");
ts.insert(ts.begin()+1,'b');
std::cout<<"the string is " << ts << ".";
return 0;
}
If you replace
ts.insert(ts.begin()+1,'b');
with
ts.push_back('b');
or
ts.insert(1, "b");
then it works.
It would appear to be a bug that stops it working in your case (I can't see
anything wrong with your code). You can report it here:
http://connect.microsoft.com/feedback/default.aspx?SiteID=210
--
John Carson