From 9f3814c755314f7e0ec0aeb7ff04b69d289408e0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 17 Jun 2017 18:58:24 -0600 Subject: [PATCH] Explicitly delete copy constructor and operator. --- include/deal.II/dofs/dof_handler.h | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index 2d8953dddf..6ca43aec0f 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -309,11 +309,27 @@ public: */ DoFHandler ( const Triangulation &tria); + /** + * Copy constructor. DoFHandler objects are large and expensive. + * They should not be copied, in particular not by accident, but + * rather deliberately constructed. As a consequence, this constructor + * is explicitly removed from the interface of this class. + */ + DoFHandler (const DoFHandler &) = delete; + /** * Destructor. */ virtual ~DoFHandler (); + /** + * Copy operator. DoFHandler objects are large and expensive. + * They should not be copied, in particular not by accident, but + * rather deliberately constructed. As a consequence, this operator + * is explicitly removed from the interface of this class. + */ + DoFHandler &operator = (const DoFHandler &) = delete; + /** * Assign a Triangulation and a FiniteElement to the DoFHandler and compute * the distribution of degrees of freedom over the mesh. @@ -890,22 +906,6 @@ public: private: - /** - * Copy constructor. I can see no reason why someone might want to use it, - * so I don't provide it. Since this class has pointer members, making it - * private prevents the compiler to provide it's own, incorrect one if - * anyone chose to copy such an object. - */ - DoFHandler (const DoFHandler &); - - /** - * Copy operator. I can see no reason why someone might want to use it, so I - * don't provide it. Since this class has pointer members, making it private - * prevents the compiler to provide it's own, incorrect one if anyone chose - * to copy such an object. - */ - DoFHandler &operator = (const DoFHandler &); - /** * An object containing information on the block structure. -- 2.39.5