How to check if compiler is C++11 with C++

1 Answer

0 votes
#include <iostream>
 
int main() {
    #if __cplusplus == 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
        std::cout << "Compiler is C++11";
    #else
        std::cout << "Compiler is not C++11";
    #endif
}


 
 
 
/*
run:
 
Compiler is C++11
 
*/

 



answered Apr 22, 2022 by avibootz
edited Apr 22, 2022 by avibootz

Related questions

1 answer 206 views
206 views asked Apr 22, 2022 by avibootz
1 answer 155 views
155 views asked Apr 22, 2022 by avibootz
1 answer 159 views
159 views asked Apr 22, 2022 by avibootz
1 answer 246 views
1 answer 179 views
2 answers 226 views
...