Skip to content

Commit

Permalink
restrict static_assert to >= C++20 (except in MSVC where __cplusplus …
Browse files Browse the repository at this point in the history
…isn't correctly set by default)
  • Loading branch information
geoffthemedio committed Apr 20, 2024
1 parent d81c662 commit fcc1fd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GG/src/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ namespace {
}();
static_assert(std::string_view{three_zero.data()} == "30");

#if defined(__cpp_lib_constexpr_string) && ((!defined(__GNUC__) || (__GNUC__ > 11))) && ((!defined(_MSC_VER) || (_MSC_VER >= 1934)))
#if defined(__cpp_lib_constexpr_string) && \
(defined(_MSC_VER) || defined(__cplusplus) && (__cplusplus >= 202002L)) && \
(!defined(_MSC_VER) || (_MSC_VER >= 1934))
static_assert([](){
const std::string str{"a"};
return str.size() >= 1 &&
Expand Down

0 comments on commit fcc1fd9

Please sign in to comment.