Skip to content
Snippets Groups Projects
Commit a461a823 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[timedlogging] add logging of operator= in EnableDebugLoggingForCtors

parent 1cb60b90
No related branches found
No related tags found
No related merge requests found
...@@ -256,6 +256,8 @@ int main() { ...@@ -256,6 +256,8 @@ int main() {
template <typename T = void> template <typename T = void>
class EnableDebugLoggingForCtors class EnableDebugLoggingForCtors
{ {
typedef EnableDebugLoggingForCtors<T> ThisType;
public: public:
EnableDebugLoggingForCtors(const std::string& EnableDebugLoggingForCtors(const std::string&
#ifndef NDEBUG #ifndef NDEBUG
...@@ -278,7 +280,7 @@ public: ...@@ -278,7 +280,7 @@ public:
} }
#endif #endif
EnableDebugLoggingForCtors(const EnableDebugLoggingForCtors<T>& other) EnableDebugLoggingForCtors(const ThisType& other)
#ifndef NDEBUG #ifndef NDEBUG
: logger_(other.logger_) : logger_(other.logger_)
, class_id_(other.class_id_) , class_id_(other.class_id_)
...@@ -289,7 +291,7 @@ public: ...@@ -289,7 +291,7 @@ public:
= default; = default;
#endif #endif
EnableDebugLoggingForCtors(EnableDebugLoggingForCtors<T>&& source) EnableDebugLoggingForCtors(ThisType&& source)
#ifndef NDEBUG #ifndef NDEBUG
: logger_(std::move(source.logger_)) : logger_(std::move(source.logger_))
, class_id_(std::move(source.class_id_)) , class_id_(std::move(source.class_id_))
...@@ -309,6 +311,25 @@ public: ...@@ -309,6 +311,25 @@ public:
= default; = default;
#endif #endif
ThisType& operator=(const ThisType& other)
#ifndef NDEBUG
{
logger_.debug() << class_id_ << "operator=(this=" << this << ", other=" << &other << ")" << std::endl;
}
#else
= default;
#endif
ThisType& operator=(ThisType&& source)
#ifndef NDEBUG
{
logger_.debug() << class_id_ << "operator=(this=" << this << ", source=" << &source << ")" << std::endl;
}
#else
= default;
#endif
#ifndef NDEBUG #ifndef NDEBUG
protected: protected:
TimedLogManager logger_; TimedLogManager logger_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment