From 93b9132b0a1e68cb4c5dcde1bad2ddea7f0726f4 Mon Sep 17 00:00:00 2001 From: Daniil Date: Thu, 13 Oct 2022 08:25:16 +0300 Subject: [PATCH] Replace iterator difference with std::distance --- include/spdlog/common-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/common-inl.h b/include/spdlog/common-inl.h index 9fd2bcb54..728f98317 100644 --- a/include/spdlog/common-inl.h +++ b/include/spdlog/common-inl.h @@ -34,7 +34,7 @@ SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG { auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name); if (it != std::end(level_string_views)) - return static_cast(it - std::begin(level_string_views)); + return static_cast(std::distance(std::begin(level_string_views), it)); // check also for "warn" and "err" before giving up.. if (name == "warn")