summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-12-13 00:59:53 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2018-01-03 10:39:50 +0100
commitbd6adff9a59d3dc61de77ca54094a7e16ae548be (patch)
tree842faeebc1c26706f465de9a48e3114d53ce36ea
parent11e5e94ac2f0acb1eaf951ff125018c607904398 (diff)
C++: implement missing copy operator
It's good practice to implement the copy operator, even if not needed at the moment. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--src/dbus/server/pim/folks.h6
-rw-r--r--src/gdbusxx/gdbus-cxx-bridge.h7
-rw-r--r--src/syncevo/util.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/src/dbus/server/pim/folks.h b/src/dbus/server/pim/folks.h
index bf2f9dcf..83483f5c 100644
--- a/src/dbus/server/pim/folks.h
+++ b/src/dbus/server/pim/folks.h
@@ -146,6 +146,12 @@ class IndividualDataCompare : public std::binary_function<IndividualData, Indivi
{
return m_compare->compare(a.m_criteria, b.m_criteria);
}
+
+ IndividualDataCompare & operator = (const IndividualDataCompare &other)
+ {
+ m_compare = other.m_compare;
+ return *this;
+ }
};
/**
diff --git a/src/gdbusxx/gdbus-cxx-bridge.h b/src/gdbusxx/gdbus-cxx-bridge.h
index 131478ba..9eeefc9f 100644
--- a/src/gdbusxx/gdbus-cxx-bridge.h
+++ b/src/gdbusxx/gdbus-cxx-bridge.h
@@ -197,6 +197,13 @@ class DBusConnectionPtr : public boost::intrusive_ptr<GDBusConnection>
m_name(other.m_name)
{}
+ DBusConnectionPtr & operator = (const DBusConnectionPtr &other)
+ {
+ *static_cast<boost::intrusive_ptr<GDBusConnection> *>(this) = static_cast<const boost::intrusive_ptr<GDBusConnection> &>(other);
+ m_name = other.m_name;
+ return *this;
+ }
+
GDBusConnection *reference(void) throw()
{
GDBusConnection *conn = get();
diff --git a/src/syncevo/util.h b/src/syncevo/util.h
index 20a8a452..41207f96 100644
--- a/src/syncevo/util.h
+++ b/src/syncevo/util.h
@@ -363,6 +363,7 @@ template<class T> class Init {
Init() : m_value(boost::value_initialized<T>()) {}
Init(const Init &other) : m_value(other.m_value) {}
Init & operator = (const T &val) { m_value = val; return *this; }
+ Init & operator = (const Init &other) { m_value = other.m_value; return *this; }
operator const T & () const { return m_value; }
operator T & () { return m_value; }
private: