diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-12-21 08:11:54 -0800 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2018-01-03 10:39:51 +0100 |
commit | 88619eb58cc9d4470d743e0c732e945da28a7eb2 (patch) | |
tree | 037dece46689cf0a4f5fbce889cdcfd018f8f9aa /src/gdbus | |
parent | 52a34570373fc3d03e69456c2d4f460265bf9a22 (diff) |
C++: replace auto_ptr with unique_ptr
auto_ptr has been deprecated for a while now. unique_ptr can
be taken for granted now, so use that instead.
GDBusMessage requires a custom deleter. Not sure how auto_ptr
handled that before.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Diffstat (limited to 'src/gdbus')
-rw-r--r-- | src/gdbus/gdbus-cxx-bridge.h | 2 | ||||
-rw-r--r-- | src/gdbus/test/example.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gdbus/gdbus-cxx-bridge.h b/src/gdbus/gdbus-cxx-bridge.h index c3a0c910..82fbdf9f 100644 --- a/src/gdbus/gdbus-cxx-bridge.h +++ b/src/gdbus/gdbus-cxx-bridge.h @@ -1977,7 +1977,7 @@ class DBusResult : virtual public Result virtual Watch *createWatch(const boost::function<void (void)> &callback) { - std::auto_ptr<Watch> watch(new Watch(m_conn, callback)); + std::unique_ptr<Watch> watch(new Watch(m_conn, callback)); watch->activate(dbus_message_get_sender(m_msg.get())); return watch.release(); } diff --git a/src/gdbus/test/example.cpp b/src/gdbus/test/example.cpp index 32e09f15..be155759 100644 --- a/src/gdbus/test/example.cpp +++ b/src/gdbus/test/example.cpp @@ -65,7 +65,7 @@ class Test { static gboolean method_idle(gpointer data) { - std::auto_ptr<async> mydata(static_cast<async *>(data)); + std::unique_ptr<async> mydata(static_cast<async *>(data)); std::cout << "replying to method_async" << std::endl; mydata->m_result->done("Hello World, asynchronous and delayed"); return false; @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) exit(1); } - std::auto_ptr<DBusTest> test(new DBusTest(conn)); + std::unique_ptr<DBusTest> test(new DBusTest(conn)); test->activate(); test->signal(42, "hello world", std::map<int32_t, int32_t>()); test->deactivate(); |