]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added move assignment operator to Subscriptor
authordanshapero <shapero.daniel@gmail.com>
Mon, 11 Apr 2016 23:16:58 +0000 (16:16 -0700)
committerdanshapero <shapero.daniel@gmail.com>
Wed, 13 Apr 2016 18:39:20 +0000 (11:39 -0700)
include/deal.II/base/subscriptor.h
source/base/subscriptor.cc

index d4fd6d9df7e24c7186cdbb211941b1ba97742ad4..07b2d1e29c43f8bb43945e421e9803ad0c1b774a 100644 (file)
@@ -92,6 +92,15 @@ public:
    */
   Subscriptor &operator = (const Subscriptor &);
 
+#ifdef DEAL_II_WITH_CXX11
+  /**
+   * Move assignment operator.
+   *
+   * Asserts that the counter for the moved object is zero.
+   */
+  Subscriptor &operator = (Subscriptor &&);
+#endif
+
   /**
    * Subscribes a user of the object. The subscriber may be identified by text
    * supplied as <tt>identifier</tt>.
index 6fc9dde29d394ea31c7dbb6cb078a156ab9c9983..fa2793aa2e9804981bafc945d2abf8927a5686fa 100644 (file)
@@ -159,6 +159,16 @@ Subscriptor &Subscriptor::operator = (const Subscriptor &s)
 
 
 
+#ifdef DEAL_II_WITH_CXX11
+Subscriptor &Subscriptor::operator = (Subscriptor &&s)
+{
+  s.check_no_subscribers();
+  object_info = s.object_info;
+  return *this;
+}
+#endif
+
+
 void
 Subscriptor::subscribe(const char *id) const
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.