jeudi 23 juillet 2020

Language supported in Visual studio for C++ __cplusplus is showing as C++98

I'm trying to run C++11 in my project. I add the compiler flag /std:c++11 to the compiler and when I check the version and print it out, it shows as c++98. When I want to use C++11 and above. This is all in visual studio 2019.

This is what I'm using to print the language and it shows as C++98.

if (__cplusplus == 201703L) std::cout << "C++17\n";
else if (__cplusplus == 201402L) std::cout << "C++14\n";
else if (__cplusplus == 201103L) std::cout << "C++11\n";
else if (__cplusplus == 199711L) std::cout << "C++98\n";
else std::cout << "pre-standard C++\n";

std::cout << "C++ langauge supported = " << __cplusplus << "\n";```

Aucun commentaire:

Enregistrer un commentaire