views:

57

answers:

1

I have just installed Visual C++ 2010 Express and I have the impression that the default mode includes C++0x features and the std::tr1 library.

error C2872: 'is_same' : ambiguous symbol
        could be 'C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\type_traits(941) : std::tr1::is_same'

Could you confirm that? If this is the case, is there some way to disable the default settings?

Why the tr1 symbols are visible? is there a using inside the MS headers?

+2  A: 

YES : VC10 provide some C++0x featrues (auto, decltype, r-value reference, etc) and std::tr1 inside std namespace and it's not optional AFAIK.

However, you can still use VS2010 with VC9 (that don't have those features) if you have it installed too. To do this, just change the compiler version in the project setting from 100 (vc10) to 90 (vc9). In this context, std::tr1 will be available in std::tr1 namespace.

Klaim
I was not enough clear. I use directly the command line not the IDE. Thanks anyway.I don't do any using std. How is it that the tr1 symbols are visible?
Vicente Botet Escriba
Ok then you'll be stuck with those features. If you didn't write any using namespace std; then you should check the headers of the libraries you're using. All standard library is in std namespace so it's the only way to access it. Maybe check the macros in the traits header see if one could put std namespace in global namespace?
Klaim
Your are right. There were some using namespace std in the testing code.
Vicente Botet Escriba