23 #if defined(__GNUG__) && !defined(__clang__) // gcc 30 # ifndef JASL_cpp_constexpr 31 # ifdef __cpp_constexpr 32 # define JASL_cpp_constexpr __cpp_constexpr 34 # define JASL_cpp_constexpr \ 39 : (__GNUC__ == 4L && __GNUC_MINOR__ >= 6L ? 200704L \ 41 # endif // __cpp_constexpr 42 # endif // JASL_cpp_constexpr 43 # ifndef JASL_cpp_lib_string_view 44 # ifdef __cpp_lib_string_view 45 # define JASL_cpp_lib_string_view __cpp_lib_string_view 47 # define JASL_cpp_lib_string_view \ 48 (__cplusplus >= 201703 && \ 49 (__GNUC__ > 7L || (__GNUC__ == 7L && __GNUC_MINOR__ >= 1L)) \ 52 # endif // __cpp_lib_string_view 53 # endif // JASL_cpp_lib_string_view 55 #elif defined(__clang__) // clang 57 # ifndef JASL_cpp_constexpr 58 # ifdef __cpp_constexpr 59 # define JASL_cpp_constexpr __cpp_constexpr 61 # error "Probably unsupported compiler version!" 63 # endif // JASL_cpp_constexpr 64 # ifndef JASL_cpp_lib_string_view 65 # ifdef __cpp_lib_string_view 66 # define JASL_cpp_lib_string_view __cpp_lib_string_view 67 # elif __cplusplus >= 201703 68 # define JASL_cpp_lib_string_view (__has_include(<string_view>) ? 201606L : 0L) 70 # define JASL_cpp_lib_string_view 0L 72 # endif // JASL_cpp_lib_string_view 74 #elif defined(_MSC_VER) // msvc 81 # ifndef JASL_cpp_constexpr 82 # ifndef __cpp_constexpr 83 # define JASL_cpp_constexpr \ 84 (_MSC_VER >= 1911L && _MSVC_LANG >= 201703L \ 86 : (_MSC_VER >= 1910L && _MSVC_LANG >= 201402L \ 88 : (_MSC_VER >= 1900L ? 200704L : 0L))) 89 # else // it works from 1915L 90 # define JASL_cpp_constexpr __cpp_constexpr 91 # endif // __cpp_constexpr 92 # endif // JASL_cpp_constexpr 93 # ifndef JASL_cpp_lib_string_view 94 # ifndef __cpp_lib_string_view 95 # define JASL_cpp_lib_string_view \ 96 (__cplusplus >= 201703 && _MSC_VER >= 1910L && _MSVC_LANG >= 201703L \ 100 # define JASL_cpp_lib_string_view __cpp_lib_string_view 101 # endif // __cpp_lib_string_view 102 # endif // JASL_cpp_lib_string_view 106 # if !defined(JASL_cpp_constexpr) || !defined(JASL_cpp_lib_string_view) 108 "Unsupported compiler! In case of an unsupported compiler JASL_cpp_constexpr and JASL_cpp_lib_string_view macros should be defined manually according to the used compiler (constexpr) and the used std library (std::string_view)." 111 #endif // <compiler types> 113 #if !JASL_cpp_constexpr 114 # undef JASL_cpp_constexpr 115 #endif // !JASL_cpp_constexpr 117 #if !JASL_cpp_lib_string_view 118 # undef JASL_cpp_lib_string_view 119 #endif // !JASL_cpp_lib_string_view 125 #ifdef JASL_cpp_constexpr 126 # if JASL_cpp_constexpr >= 201304L 127 # define JASL_CONSTEXPR_CXX14 constexpr 128 # elif JASL_cpp_constexpr >= 200704L 129 # define JASL_CONSTEXPR_CXX14 132 # error "Something wrong with the defines." 134 #else // ifdef JASL_cpp_constexpr 136 # error "Unsupported C++ standard!" 137 #endif // ifdef JASL_cpp_constexpr 139 #ifdef __cpp_lib_is_swappable 140 # define JASL_is_nothrow_swappable_value(type) \ 141 (std::is_nothrow_swappable<type>::value) 144 # define JASL_is_nothrow_swappable_value(type) \ 145 (std::is_nothrow_move_constructible<type>::value && \ 146 std::is_nothrow_move_assignable<type>::value)