__cplusplus < 201402L return true in gcc even when I specified -std=c++14
问题 The directive: #ifndef __cplusplus #error C++ is required #elif __cplusplus < 201402L #error C++14 is required #endif The command-line: g++ -Wall -Wextra -std=c++14 -c -o header.o header.hpp My g++ version: g++ (tdm-1) 4.9.2 The error C++14 is required is generated even when I added -std=c++14 , I don't know why. Please tell me how to fix this. 回答1: According to the GCC CPP manual (version 4.9.2 and 5.1.0): __cplusplus This macro is defined when the C++ compiler is in use. You can use _