From 60527f2c4beaf0f06282f783b9be6d73804bc61f Mon Sep 17 00:00:00 2001 From: Felix Heitmann Date: Fri, 10 Mar 2023 08:39:56 +0100 Subject: [PATCH] Re-patch log_attr: make it valid for all integral/floating types --- include/spdlog/details/log_attr.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/spdlog/details/log_attr.h b/include/spdlog/details/log_attr.h index e1cab9b3..84a1d586 100644 --- a/include/spdlog/details/log_attr.h +++ b/include/spdlog/details/log_attr.h @@ -43,6 +43,12 @@ public: , value{v} {} + template + requires std::integral || std::floating_point + attr(string_view_t k, T v) : value{std::to_string(v)} { + key = std::string{k.data(), k.size()}; + } + attr(string_view_t k, long v) : value{std::to_string(v)} {