add constexpr to SPDLOG_LEVEL_NAMES declaration

for #1791
This commit is contained in:
Gaurav Vaidya
2021-01-11 11:15:29 +01:00
parent aa2053a575
commit 53d223b45f
3 changed files with 4 additions and 4 deletions

View File

@@ -9,11 +9,11 @@
namespace spdlog {
namespace level {
static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
static FMT_CONSTEXPR string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES;
SPDLOG_INLINE string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
SPDLOG_INLINE const string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
{
return level_string_views[l];
}