celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject celix git commit: CELIX-370: Fixes move constructor
Date Wed, 27 Jul 2016 11:06:35 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 0b617d736 -> 81de941a6


CELIX-370: Fixes move constructor


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/81de941a
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/81de941a
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/81de941a

Branch: refs/heads/develop
Commit: 81de941a6b669b5dde9dc17c5950ad4cba97f422
Parents: 0b617d7
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Wed Jul 27 13:05:52 2016 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Wed Jul 27 13:05:52 2016 +0200

----------------------------------------------------------------------
 examples/dm_example_cxx/phase2/include/Phase2Cmp.h | 8 +-------
 examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc  | 6 ++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/81de941a/examples/dm_example_cxx/phase2/include/Phase2Cmp.h
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase2/include/Phase2Cmp.h b/examples/dm_example_cxx/phase2/include/Phase2Cmp.h
index cff9d6d..a0de396 100644
--- a/examples/dm_example_cxx/phase2/include/Phase2Cmp.h
+++ b/examples/dm_example_cxx/phase2/include/Phase2Cmp.h
@@ -34,13 +34,7 @@ extern "C" {
 class Phase2Cmp : public IPhase2 {
 public:
     Phase2Cmp() = default;
-    Phase2Cmp(Phase2Cmp&& other) : phase1(nullptr), logSrv{nullptr} {
-        std::cout << "Move constructor Phase2Cmp called\n";
-        this->phase1 = phase1;
-        this->logSrv = logSrv;
-        other.phase1 = nullptr;
-        other.logSrv = nullptr;
-    }
+    Phase2Cmp(Phase2Cmp&& other);
     Phase2Cmp(const Phase2Cmp& other) = delete;
     virtual ~Phase2Cmp() { std::cout << "Destroying Phase2\n"; };
 

http://git-wip-us.apache.org/repos/asf/celix/blob/81de941a/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc b/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
index 55e258a..f2af7ec 100644
--- a/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
+++ b/examples/dm_example_cxx/phase2a/src/Phase2aCmp.cc
@@ -22,6 +22,12 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+Phase2Cmp::Phase2Cmp(Phase2Cmp&& other) : phase1(other.phase1), logSrv{other.logSrv}
{
+    std::cout << "Move constructor Phase2Cmp called\n";
+    other.phase1 = nullptr;
+    other.logSrv = nullptr;
+}
+
 void Phase2Cmp::setPhase1(IPhase1* phase1) {
     std::cout << "setting phase1 for phase2\n";
     this->phase1 = phase1;


Mime
View raw message