From: Mikko Rasa Date: Thu, 30 Aug 2018 10:41:06 +0000 (+0300) Subject: Use const references in BuildInfo::Tracked operators X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7885ebe9620edd82f119eb290267c8e7eda014ed;p=builder.git Use const references in BuildInfo::Tracked operators --- diff --git a/source/buildinfo.h b/source/buildinfo.h index 1bba819..5528748 100644 --- a/source/buildinfo.h +++ b/source/buildinfo.h @@ -66,8 +66,8 @@ public: Tracked(T v): value(v), set(false) { } Tracked &operator=(const Tracked &v) { if(v.set) { value = v.value; set = true; } return *this; } - Tracked &operator=(T v) { value = v; set = true; return *this; } - operator T() const { return value; } + Tracked &operator=(const T &v) { value = v; set = true; return *this; } + operator const T &() const { return value; } }; typedef std::map DefineMap;