Difference between gcc compile options std=c++1y and std=c++14

C++ 14 is the latest ISO standard, and should be used unless you need some gcc non standard feature.

c++1y is a name that was used to refer to the c++14 standard before it was completed, so it is most likely adhering to a draft of the standard, but not the actual standard itself. There may be some minute differences between the two, but c++14 is the ISO standard.

In short, use c++14.


In case of gcc 4.9.2 mentioned by you there is no difference between c++14 and c++1y. But for the earlier gcc version, e.g. gcc 4.8.1 there is no c++14 option

g++: error: unrecognized command line option '-std=c++14'

because the year of standard acceptance was not known yet. In such cases using the -std=c++1y option is only solution to enable some parts of oncoming c++14 standard.

Tags:

C++

Gcc

C++14