Why does GCC 6.3 compile this Braced-Init-List code without explicit C++11 support?

后端 未结 1 1127
礼貌的吻别
礼貌的吻别 2021-02-13 17:01

I have a question about the different meanings of a curly-brace enclosed list.

I know that C++03 did not support C++11\'s initializer_list. Yet, even withou

相关标签:
1条回答
  • 2021-02-13 17:37

    The default compiler command for gcc 6.x is -std=gnu++14, so the compiler is implicitly compiling your code using a later version of the C++ language standard.

    You will need to manually specify -std=c++03 if you want to compile in C++03.

    0 讨论(0)
提交回复
热议问题