MS Visual Studio 2012 for Windows Desktop - C++11 features - c++

I use MS Visual Studio 2012 for Windows Desktop (C++) and I've recently started using C++11 features,such as range-based for loop,lambda functions,final,override and so on.
But I cannot use some of the features,like std::initializer_list,user-defined signatures...
I don't understand why this version of MS Visual Studio does support some,but not all of them.
Should I start using a newer version,or what?
Thanks.

Yes, you should start using a newer version, because as it happens, newer versions implement new features.
Also, your question doesn't really ask a question.

You can find comparison tables of supported C++11 features in recent versions of Visual Studio on the MSDN website: http://msdn.microsoft.com/en-us/library/hh567368.aspx

Related

Intel C++ Compiler Installer not finding Visual Studio

So I was trying to install the Intel C++ Compiler (in the Parallel Studio XE 2018 bundle) and when I go to install it comes up with the warning "Intel C++ Compiler will not work because none of the supported environments is found on your computer," among others. However, one of those supported environments is Microsoft Visual Studio 2017, which I have installed.
I read online that there's some issue with the most recent versions of Visual Studio and that the compiler only works with versions 15.6 and below. I have 15.5.6, but of the Community version. I'm not sure if the Professional version is required; if it is I don't have it installed and I can't figure how to install a previous version.
If there is no way to make this work (or there is, but it's too much of a pain), suggestions for other C++ compilers would be appreciated.
You could see this document about “Troubleshooting Fortran Integration Issues with Microsoft Visual Studio*”:
https://software.intel.com/en-us/articles/troubleshooting-fortran-integration-issues-with-visual-studio/
It shared the version of Visual Studio that is supported by the Intel Parallel Studio XE now.

Is installing Visual studio 2015 enterprise edition sufficient to work with C++11/C++14?

I want to work with C++ 11 (if not C++ 14). I am installing visual studio 2015 enterprise edition. Is this sufficient?
Basically, yes. Most of C++11 has been implemented in VS2015. Most of C++14 has been implemented in VS2017.
Completely? No.
There are still various missing features (expression SFINAE) and bugs in the Microsoft compiler implementations of C++. If and when you run into these limitations depends on the style of code you write.
You can check that on MSDN or cppreference
A screenshot from MSDN:

How to "activate" c++11 standard in visual studio 2010?

I am new to c++ programming and I need to use the Thread class in my VS 2010 project.
I've found this reference, but when I try the following:
#include <thread>
VS 2010 obviously tells me 'Error: cannot open source file "thread"'. I understand that I need to "activate" c++11 standard somehow. I do not even know where to start.
So what should I do to use () c++11 standard in visual studio 2010?
std::thread is obviously not in VS 2010. I think it was added with VS 2012, which is also supported by this question and answer. Is there any specific reason you're using 2010 rather than the latest version, 2013, which supports far more part of C++11?
Also to note: Contrary to GCC, MSVC doesn't have an "opt-in" for newer standards. It just supports them out of the box as far as implemented.
The Visual C++ compiler is not fully C++11 compatible. C++11 features had been supported since Visual Studio 2010 and added incrementally. Not even the next version of Visual Studio will provide full C++11 compatibility. A matrix of C++11 features available in different versions of Visual Studio can be found here:
C++0x Core Language Features In VC10: The Table
C++11 Features in Visual C++ 11
C++11/14 STL Features, Fixes, And Breaking Changes In VS 2013
C++11 is enabled by default, but there is not many features implemented in VS 2010. C++11 standard library is missing many headers in VS 2010. Here is a comparison of a last few VS releases regarding the C++11 support.
Here's what I've found by myself.
To "activate" c++11 in visual studio you need to set "Platform Toolset" in project->properties to v110 or above. So that's how visual studio will understand that it should use c++11 features.
BUT!
The Visual C++ compiler is not fully C++11 compatible. C++11 features had been supported since Visual Studio 2010 and added incrementally. Not even the next version of Visual Studio will provide full C++11 compatibility.
Marius Bancila
So it worked for <thread> (and <future>) in visual studio 2012.
As I suggest it's impossible to set Platform Toolset above v100 in vs2010, so it's impossible to "activate" c++11 in vs2010.
Conclusion:
to use c++11 standart features in visual studio you will need to use 2012 and higher version which supports Platform Toolset v110 and above.
Correct me please if I'm wrong!
d= (◕‿↼ ) C++11 is enabled by default, But unfortunately, not even "Visual Studio 2017" is fully C++11 compliant.
(I got here while building Boost, which's build section only mentions their need for C++11 compliant compiler, and NOT with what MSVC version they tested Boost.)
Microsoft says:
"Support for C11 and C17 standards is available in Visual Studio 2019 version 16.8 and later"
But I didn't test their claim yet.

Visual Studio 2010: chrono header file missing

I just installed Visual Studio 2010 Ultimate and wanted to write a simple program in C++.
But it seems like VS doesn't find the header file "chrono".
I tought installing SP1 would help, but it didn't.
There also some other header files like "thread" missing.
Does anyone know where I can get these missing files?
VS2010 only has partial C++11 support. You need VS2012+.
As an addition to Mark's answer, no Visual Studio version fully supports C++11 now. Here is the complete table of features: C++11 Features (Modern C++)
You can also read here for getting more information BOOST
Chrono is a standard template library that has been introduced in Visual Studio 2012.
Chrono is used to manipulate time durations and time instants.
Visual Studio 2010 or even with SP1 will not support Chrono.

Linking against older version of runtime with newer version of MSVC?

I own VS 2008 Pro, and would like to do compatibility testing with VS 2005's runtime MSVCRT80, but I do not want to buy it just for that. Is there a way to link against MSVCRT80 without getting VS 2005?
Thanks
Official support for native multi-targeting didn't appear until Visual Studio 2010, which allows you to select either v100 or v90 as your "Platform Toolset". There is no such feature in Visual Studio 2008.
There is a discussion here on how one can achieve the same effect in Visual Studio 2008, but it appears you need to have VS 2005 installed on your computer as well in order for this to work. It isn't going to work if you just have the runtime libraries installed because you need the proper version of the compiler and linker, which you'll only have if you install VS 2005.
On that note, I'm not really sure what you mean by "compatibility testing". If you compile your app against v90 in VS 2008, it's not going to work with the older versions of the runtime. You have to compile and link against the version you want your app to use.
Finally, consider whether it's really relevant or not. Since you must include MSVCRT with your application anyway, what's the advantage of trying to link against an older version of the runtime? Just include v90 and be done with it.
Links to a still-working (as of 11 Jan 2011) Microsoft download for Visual C++ Express 2005 can be found here:
http://apdubey.blogspot.com/2009/04/microsoft-visual-studio-2005-express.html
This should let you compile against the VS2005 runtime without having to buy anything.
(in case the blogspot article goes away, the link for the .iso is http://go.microsoft.com/fwlink/?linkid=57034).