From 102c31a04cad2e7a9455cddee20806871ae5e438 Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 4 Oct 2018 02:06:39 +0300 Subject: [PATCH] Accecpt iterators by value in logger ctor insted of ref --- include/spdlog/async_logger.h | 2 +- include/spdlog/details/async_logger_impl.h | 2 +- include/spdlog/details/logger_impl.h | 2 +- include/spdlog/logger.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 4b538f10..73f34ced 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -46,7 +46,7 @@ class async_logger final : public std::enable_shared_from_this, pu public: template - async_logger(std::string logger_name, const It &begin, const It &end, std::weak_ptr tp, + async_logger(std::string logger_name, It begin, It end, std::weak_ptr tp, async_overflow_policy overflow_policy = async_overflow_policy::block); async_logger(std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp, diff --git a/include/spdlog/details/async_logger_impl.h b/include/spdlog/details/async_logger_impl.h index 9c4d7616..2923a10e 100644 --- a/include/spdlog/details/async_logger_impl.h +++ b/include/spdlog/details/async_logger_impl.h @@ -16,7 +16,7 @@ template inline spdlog::async_logger::async_logger( - std::string logger_name, const It &begin, const It &end, std::weak_ptr tp, async_overflow_policy overflow_policy) + std::string logger_name, It begin, It end, std::weak_ptr tp, async_overflow_policy overflow_policy) : logger(std::move(logger_name), begin, end) , thread_pool_(tp) , overflow_policy_(overflow_policy) diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 277adb11..84e9c3d1 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -13,7 +13,7 @@ // create logger with given name, sinks and the default pattern formatter // all other ctors will call this one template -inline spdlog::logger::logger(std::string logger_name, const It &begin, const It &end) +inline spdlog::logger::logger(std::string logger_name, It begin, It end) : name_(std::move(logger_name)) , sinks_(begin, end) , level_(level::info) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index b0398f26..9df57c9b 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -36,7 +36,7 @@ public: logger(std::string name, sinks_init_list sinks); template - logger(std::string name, const It &begin, const It &end); + logger(std::string name, It begin, It end); virtual ~logger();