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 198 views
198 views asked Apr 22, 2022 by avibootz
1 answer 151 views
151 views asked Apr 22, 2022 by avibootz
1 answer 153 views
153 views asked Apr 22, 2022 by avibootz
1 answer 238 views
1 answer 171 views
2 answers 221 views
...