Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ versions, what they mean, how to update them

Tags:

c++

version

Is the c++ version you use tied to the version of compiler you have or IDE? If it isn't either of those, how do I use c++ 11 on my IDE? How do i update what C++ version i use in my programs? How do I check what version I'm using?

I know that printing the __cplusplus variable can tell me what version I'm using, but this doesn't answer my other questions, neither does it answer my third question, because: https://stackoverflow.com/a/14131551/10938047

Found this question, with the answer containing an outdated link. Visual Studio 2012 __cplusplus and C++ 11

like image 709
checksumHashi Avatar asked Sep 12 '25 00:09

checksumHashi


1 Answers

The C++ version you can use is obviously tied to the compiler you use. If your compiler doesn't support some newer standard then of course you cannot use it.

As for IDEs; some IDEs are tied to a specific compiler, some can use different ones.

Some compilers support multiple language versions but require you to explicitly enable anything newer than what they enable by default. For example; most older versions of GCC support C++17 just fine, but default to C++11 or C++14 unless you tell them to enable C++17 support via the -std=c++17 command line option.

like image 183
Jesper Juhl Avatar answered Sep 13 '25 14:09

Jesper Juhl