From: Wolfgang Bangerth Date: Thu, 24 Aug 2017 17:14:05 +0000 (-0600) Subject: Equip VectorMemory::Pointer with a move assignment operator. X-Git-Tag: v9.0.0-rc1~1171^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c67f32d273635f50808c899095a1768c2a61c96b;p=dealii.git Equip VectorMemory::Pointer with a move assignment operator. --- diff --git a/include/deal.II/lac/vector_memory.h b/include/deal.II/lac/vector_memory.h index 99fe0435fd..1c7aacdece 100644 --- a/include/deal.II/lac/vector_memory.h +++ b/include/deal.II/lac/vector_memory.h @@ -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 > { 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 &mem);