From: Wolfgang Bangerth Date: Sun, 18 Jun 2017 00:58:24 +0000 (-0600) Subject: Explicitly delete copy constructor and operator. X-Git-Tag: v9.0.0-rc1~1487^2~13 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f3814c755314f7e0ec0aeb7ff04b69d289408e0;p=dealii.git Explicitly delete copy constructor and operator. --- 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.