jeudi 25 juin 2020

How to detect if VS C++ compiler supports C++11?

How to detect if Visual Studio (VS) C++ compiler supports C++11 through preprocessor macros? I tried with __cplusplus (the preprocessor macro that many people advise to use for this kind of checks) but it fails with VS C++ 2010 compiler (i.e. function get_dimension is never declared):

#if __cplusplus > 199711L
    int get_dimension(int index);
#endif

Aucun commentaire:

Enregistrer un commentaire