]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Explicitly delete copy constructor and operator.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 18 Jun 2017 00:58:24 +0000 (18:58 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Jun 2017 03:48:47 +0000 (21:48 -0600)
include/deal.II/dofs/dof_handler.h

index 2d8953dddf7719167bafb50ce9942c10d29aa934..6ca43aec0f754d38f432cdb5efece5b4f9f6dcbd 100644 (file)
@@ -309,11 +309,27 @@ public:
    */
   DoFHandler ( const Triangulation<dim,spacedim> &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.

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.