]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Equip VectorMemory::Pointer with a move assignment operator.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 24 Aug 2017 17:14:05 +0000 (11:14 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 24 Aug 2017 19:11:15 +0000 (13:11 -0600)
include/deal.II/lac/vector_memory.h

index 99fe0435fdec41fa7bbe5a35d09159af3a3e1fe7..1c7aacdece8430f2d2864abe99da060bf4a5dd78 100644 (file)
@@ -127,13 +127,29 @@ public:
    * memory is not destroyed using `operator delete` but returned to the
    * VectorMemory pool.
    *
-   * @author Guido Kanschat, 2009
+   * @author Guido Kanschat, 2009; Wolfgang Bangerth, 2017.
    */
   class Pointer : public std::unique_ptr<VectorType, std::function<void (VectorType *)> >
   {
   public:
     /**
-     * Constructor, automatically allocating a vector from @p mem.
+     * Default constructor. This constructor corresponds to a @p nullptr
+     * object that does not own a vector. It can, however, later be
+     * assigned another Pointer object via move assignment in which case
+     * it will steal the vector owned by the other object
+     * (as @p std::unique_ptr does).
+     */
+    Pointer() = default;
+
+    /**
+     * Move operator. This operator steals the pointer to the vector
+     * represented by this object from the one give as argument.
+     */
+    Pointer &operator = (Pointer &&) = default;
+
+    /**
+     * Constructor. This constructor automatically allocates a vector from
+     * the given vector memory object @p mem.
      */
     Pointer(VectorMemory<VectorType> &mem);
 

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.