Just moments after installing VS 2010 I found very nasty bug in its implementation of TR1 libraries:
typedef struct sTestStruct
{
char* pName;
char* pOtherName;
sTestStruct* pNext;
} sTestStruct;
sTestStruct Struct1 = {"blah", "mlah", 0};
char* pChar = bind(&sTestStruct::pName, _1)(&Struct1); // Compiler is happy here
bind(_stricmp, "blah", bind(&sTestStruct::pName, _1))(&Struct1); // bang happens here
The error message is simply astonishing:
\microsoft visual studio 10.0\vc\include\functional(447): error C2440: ‘return’ : cannot convert from ‘char *’ to ‘char *&’
What is interesting, should I switch C++ toolset to version 9.0 (essentially switching back to VS 2008), the problem went away.
If I could I would suggest that something went horribly wrong when MS were working on rvalues (or were they lvalues?) references business, but there is simply no point guessing around. I just wonder how long will it take MS to fix the problem. Obviously, problems like this could mean that this new version of VS 2010 is not ready to be used in production yet.
Also, reporting bugs to MS has always been not so easy quest.
0 Comments.