C++ Standards Support in GCC

C++Server Side ProgrammingProgramming

GCC supports different dialects of C++, corresponding to the multiple published ISO standards. Which standard it implements can be selected using the -std= command-line option.

C++98 − GCC has full support for the 1998 C++ standard as modified in 2003 and renamed to C++03 and some later defect reports.

C++11 − GCC 4.8.1 was the first complete implementation of the 2011 C++ standard, previously known as C++0x.

C++14 − GCC has full support for the latest revision of the C++ standard, which was published in 2014.

C++17 − GCC has experimental support for the next revision of the C++ standard, which is expected to be published in 2017.

You can use these different compiler supports by providing the command-line option, -std=. For example, if you want to compile a file under the C++11 implementation, you'd use −

$ g++ -std=C++11 my_file.cpp

Updated on 11-Feb-2020 12:54:12