From 59c268a5f89ba41963c47d1afe2b3af9254ed7b1 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 8 Sep 2018 16:17:22 -0700 Subject: [PATCH] Use strlen when possible since it's constexpr on gcc --- include/fmt/core.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/fmt/core.h b/include/fmt/core.h index 0fb46fa3..e4f7d1e0 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -230,6 +230,9 @@ FMT_CONSTEXPR size_t length(const Char *s) { while (*s) ++s; return s - start; } +#if FMT_GCC_VERSION +FMT_CONSTEXPR size_t length(const char *s) { return std::strlen(s); } +#endif } // namespace internal /**