[arrayfire] 123/408: Add move constructor and move assignment op

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit 4d23d4136dad5063f53d7df09a0086e8f492f9eb
Author: Filipe Maia <filipe.c.maia at gmail.com>
Date:   Thu Jul 9 00:27:02 2015 +0200

    Add move constructor and move assignment op
---
 include/af/index.h    | 16 +++++++++++++++-
 src/api/cpp/index.cpp | 11 +++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/include/af/index.h b/include/af/index.h
index 7d0763b..373804d 100644
--- a/include/af/index.h
+++ b/include/af/index.h
@@ -135,7 +135,21 @@ class AFAPI index {
     ///
     index & operator=(const index& idx0);
 
-
+#if __cplusplus > 199711L
+    ///
+    /// \brief Move constructor
+    ///
+    /// \param[in] idx0 is index to copy.
+    ///
+    index(index &&idx0);
+    ///
+    /// \brief Move assignment operator
+    ///
+    /// \param[in] idx0 is the index to be assigned to the /ref af::index
+    /// \returns a reference to this
+    ///
+    index& operator=(index &&idx0);
+#endif
 };
 
 ///
diff --git a/src/api/cpp/index.cpp b/src/api/cpp/index.cpp
index afaa716..ccc698b 100644
--- a/src/api/cpp/index.cpp
+++ b/src/api/cpp/index.cpp
@@ -94,6 +94,17 @@ index & index::operator=(const index& idx0) {
     return *this;
 }
 
+#if __cplusplus > 199711L
+index::index(index &&idx0) {
+    impl = idx0.impl;
+}
+
+index& index::operator=(index &&idx0) {
+    impl = idx0.impl;
+    return *this;
+}
+#endif
+
 
 static bool operator==(const af_seq& lhs, const af_seq& rhs) {
     return lhs.begin == rhs.begin && lhs.end == rhs.end && lhs.step == rhs.step;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list