From 30a838da28667633e16040250680b793dee271c7 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Sun, 18 Feb 2018 16:57:57 +0200 Subject: [PATCH 1/1] Explicit prohibition of the PLUGIN_LOGGER assignment. --- stglibs/logger.lib/include/stg/logger.h | 4 +++- stglibs/logger.lib/logger.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stglibs/logger.lib/include/stg/logger.h b/stglibs/logger.lib/include/stg/logger.h index 5165f0fb..60514f4a 100644 --- a/stglibs/logger.lib/include/stg/logger.h +++ b/stglibs/logger.lib/include/stg/logger.h @@ -49,11 +49,13 @@ class PLUGIN_LOGGER friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER& logger, const std::string& pluginName); public: - PLUGIN_LOGGER(const PLUGIN_LOGGER& rhs) : m_parent(rhs.m_parent), m_pluginName(rhs.m_pluginName) {} + PLUGIN_LOGGER(const PLUGIN_LOGGER& rhs) : m_parent(rhs.m_parent), m_pluginName(rhs.m_pluginName) {} // Need move here. void operator()(const char* fmt, ...) const; void operator()(const std::string& line) const; private: + PLUGIN_LOGGER& operator=(const PLUGIN_LOGGER&); // Copy assignment is prohibited. + PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn); const STG_LOGGER& m_parent; std::string m_pluginName; diff --git a/stglibs/logger.lib/logger.cpp b/stglibs/logger.lib/logger.cpp index 4a455257..20aa133a 100644 --- a/stglibs/logger.lib/logger.cpp +++ b/stglibs/logger.lib/logger.cpp @@ -1,9 +1,9 @@ +#include "stg/logger.h" + #include #include #include -#include "stg/logger.h" - #ifdef STG_TIME extern const volatile time_t stgTime; #endif -- 2.44.2