From: Maxim Mamontov Date: Sun, 18 Feb 2018 14:57:57 +0000 (+0200) Subject: Explicit prohibition of the PLUGIN_LOGGER assignment. X-Git-Tag: 2.409~27 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/30a838da28667633e16040250680b793dee271c7?ds=sidebyside Explicit prohibition of the PLUGIN_LOGGER assignment. --- 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