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.
According to the GCC CPP manual (version 4.9.2 and 5.1.0):
You can check that
g++ --std=c++14
defines__cplusplus
as:For
clang++ --std=c++14
:So a safer check should probably be:
As specified in the comment, this could mean partial C++14 support.
To check for a specific feature you could also try Boost Config (especially Macros that describe C++14 features not supported).