Don't use strlen at compile time (#2205)
This commit is contained in:
parent
c62e4c30f4
commit
7c43f8b896
@ -396,7 +396,7 @@ template <typename Char> class basic_string_view {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user