0

I am a VS user and I wanna find out info regarding to the c++ standard i am using.

i wonder how i can find out if it is c++11 standard or c++98 standard.

1 Answers1

1

MSVC is probably not going to have an updated __cplusplus until more or all of that standard's features are implemented. See the comments on this page for more information.

Instead, use the macros available in Boost.Config to test for specific features. For example, to test whether decltype is supported, you can use:

BOOST_NO_CXX11_DECLTYPE

This will be defined if the compiler does not support decltype. Depending on your version of VS vs. your version of Boost, this might not be 100% up to date. Be sure to check that Boost version for what is supported. As Boost 1.56.0 has had major delays, I am unsure what the current status of VS support is in 1.55.0, but 1.56.0 should arrive pretty soon and I would think it would fix any outstanding issues with recent VS versions.

chris
  • 60,560
  • 13
  • 143
  • 205
  • how abt std::shared_ptr and auto, those two keywords? it is c++11 if they are valid, isnt it? –  Jul 17 '14 at 03:06
  • @STNYU, Only `auto` is a keyword; `std::shared_ptr` is a class. Anyway, from the link in my post, you can check `std::shared_ptr` and `std::unique_ptr` together with `BOOST_NO_CXX11_SMART_PTR` and automatic type deduction with `BOOST_NO_CXX11_AUTO_DECLARATIONS`. If I'm getting your gist, it's not as simple as being C++11 or not C++11. MSVC does not support all of the C++11 features, even as of the new CTP. GCC and Clang do support them all now AFAIK, but that wasn't really the case until more recently. Partial support for standards is common, and there's a feature test proposal addressing that – chris Jul 17 '14 at 03:08