From c67f32d273635f50808c899095a1768c2a61c96b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 24 Aug 2017 11:14:05 -0600 Subject: [PATCH] Equip VectorMemory::Pointer with a move assignment operator. --- include/deal.II/lac/vector_memory.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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); -- 2.39.5