| 1 |
#include <iostream> |
| 2 |
|
| 3 |
#if __cpp_lib_filesystem || (defined(__cplusplus) && __cplusplus >= 201703L) |
| 4 |
#include <filesystem> |
| 5 |
#endif |
| 6 |
|
| 7 |
int main(){ |
| 8 |
|
| 9 |
#if __cpp_lib_filesystem || (defined(__cplusplus) && __cplusplus >= 201703L) |
| 10 |
char fs = std::filesystem::path::preferred_separator; |
| 11 |
std::cout << "OK: C++17 filesystem enabled" << std::endl; |
| 12 |
#endif |
| 13 |
|
| 14 |
#if defined(_MSC_VER) |
| 15 |
#if _HAS_CXX17 |
| 16 |
std::cout << "OK: MSVC has C++17 enabled" << std::endl; |
| 17 |
return EXIT_SUCCESS; |
| 18 |
#else |
| 19 |
std::cerr << "ERROR: MSVC does not have C++17 enabled" << std::endl; |
| 20 |
return EXIT_FAILURE; |
| 21 |
#endif |
| 22 |
#elif defined(__cplusplus) && __cplusplus >= 201703L |
| 23 |
std::cout << "OK: C++17 enabled" << std::endl; |
| 24 |
return EXIT_SUCCESS; |
| 25 |
#else |
| 26 |
std::cerr << "ERROR: C++17 not enabled" << std::endl; |
| 27 |
return EXIT_FAILURE; |
| 28 |
#endif |
| 29 |
} |