Does gcc
define a macro
or something else, when I use the -std=c++zz
flag? Imagine, that I have a (nice and easy and fast and...) solution in my program which only works with g++ -std=c++20
. However I want to provide a (less better but working) solution which works with -std=c++11
or something else. For example:
#ifdef __STD20__
#include <numbers>
const double PI=std::numbers::pi;
#else
const double PI=4.0*atan(1);
#endif
Or should I handle it somehow in the makefile
? Thank you for your advice.
(NOTE: the question is not about defining pi; it is just the shortest example I could provide.)