From 29f0b2d0d39c66e7ff09e1996b17c338ffe3c055 Mon Sep 17 00:00:00 2001 From: Alexandre Petitjean Date: Tue, 26 May 2015 14:31:17 +0200 Subject: [PATCH] Fix template issue --- include/spdlog/details/registry.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/spdlog/details/registry.h b/include/spdlog/details/registry.h index 45dbd94f..0b744795 100644 --- a/include/spdlog/details/registry.h +++ b/include/spdlog/details/registry.h @@ -144,14 +144,14 @@ public: _async_mode = false; } - static std::shared_ptr > instance() + static std::shared_ptr> instance() { if(!_instance) _instance = std::make_shared>(); return _instance; } - static void set_registry(std::shared_ptr > registry) + static void set_registry(std::shared_ptr> registry) { _instance = registry; } @@ -159,7 +159,7 @@ public: registry_t() {} private: - static std::shared_ptr > _instance; + static std::shared_ptr> _instance; void register_logger_impl(std::shared_ptr logger) { @@ -180,13 +180,14 @@ private: std::function _worker_warmup_cb = nullptr; std::chrono::milliseconds _flush_interval_ms; }; + +template +std::shared_ptr> registry_t::_instance = nullptr; + #ifdef SPDLOG_NO_REGISTRY_MUTEX typedef registry_t registry; # else typedef registry_t registry; #endif //SPDLOG_NO_REGISTRY_MUTEX - -std::shared_ptr registry::_instance = nullptr; - } }