| commit | 7c43f8b896be886acd4e6e0ba61f71a8aa1ebc35 | [log] [tgz] |
|---|---|---|
| author | Victor Zverovich <victor.zverovich@gmail.com> | Thu Apr 01 10:04:21 2021 -0700 |
| committer | Victor Zverovich <victor.zverovich@gmail.com> | Thu Apr 01 10:04:21 2021 -0700 |
| tree | 7042ec940f1ffa379fe73924af56afbeecfa9b51 | |
| parent | c62e4c30f4607626be40f0f8a696ec387696c761 [diff] |
Don't use strlen at compile time (#2205)
diff --git a/include/fmt/core.h b/include/fmt/core.h index 19cb05b..f88b4cf 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h
@@ -396,7 +396,7 @@ FMT_CONSTEXPR #endif FMT_INLINE basic_string_view(const Char* s) : data_(s) { - if (std::is_same<Char, char>::value) + if (std::is_same<Char, char>::value && !detail::is_constant_evaluated()) size_ = std::strlen(reinterpret_cast<const char*>(s)); else size_ = std::char_traits<Char>::length(s);