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

1 Answer

0 votes
#include <iostream>
 
int main() {
    #if __cplusplus==201402L
        std::cout << "Compiler is C++14" << std::endl;
    #elif __cplusplus==201103L
        std::cout << "Compiler is C++11" << std::endl;
    #else
        std::cout << "C++" << std::endl;
    #endif
}
 
 
 
 
/*
run:
 
Compiler is C++14
 
*/

 



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

Related questions

1 answer 304 views
304 views asked Apr 22, 2022 by avibootz
1 answer 241 views
241 views asked Apr 22, 2022 by avibootz
1 answer 240 views
240 views asked Apr 22, 2022 by avibootz
1 answer 342 views
1 answer 267 views
2 answers 335 views
...