From 545833e4f48c1a4bc59f95fe8a667b7ad219dd67 Mon Sep 17 00:00:00 2001 From: Jonathan Vannier Date: Mon, 25 Sep 2023 17:00:20 +0200 Subject: [PATCH] Remove const refs to shared pointers --- include/spdlog/details/registry-inl.h | 2 +- include/spdlog/details/registry.h | 4 ++-- tests/test_registry.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spdlog/details/registry-inl.h b/include/spdlog/details/registry-inl.h index d2b69f4d..a23655f0 100644 --- a/include/spdlog/details/registry-inl.h +++ b/include/spdlog/details/registry-inl.h @@ -267,7 +267,7 @@ SPDLOG_INLINE void registry::register_logger_(std::shared_ptr new_logger } SPDLOG_INLINE void registry::add_on_registration_callback( - const std::function&)>& callback) { + const std::function)>& callback) { std::lock_guard lock(logger_map_mutex_); on_registration_callbacks_.push_back(callback); } diff --git a/include/spdlog/details/registry.h b/include/spdlog/details/registry.h index 0aee3edc..cd7aeaa3 100644 --- a/include/spdlog/details/registry.h +++ b/include/spdlog/details/registry.h @@ -92,7 +92,7 @@ public: void apply_logger_env_levels(std::shared_ptr new_logger); - void add_on_registration_callback(const std::function&)>& callback); + void add_on_registration_callback(const std::function)>& callback); void drop_all_on_registration_callbacks(); @@ -116,7 +116,7 @@ private: std::shared_ptr default_logger_; bool automatic_registration_ = true; size_t backtrace_n_messages_ = 0; - std::vector&)>> on_registration_callbacks_; + std::vector)>> on_registration_callbacks_; }; } // namespace details diff --git a/tests/test_registry.cpp b/tests/test_registry.cpp index a9ff241e..11a56539 100644 --- a/tests/test_registry.cpp +++ b/tests/test_registry.cpp @@ -113,7 +113,7 @@ TEST_CASE("disable automatic registration", "[registry]") { TEST_CASE("add_on_registration_callback", "[registry]") { std::vector registered_logger_names; - auto on_registration_callback = [&](const std::shared_ptr& logger) + auto on_registration_callback = [&](std::shared_ptr logger) { registered_logger_names.push_back(logger->name()); };