]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Delete the copy constructor of class Triangulation.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 12 Jul 2017 16:32:52 +0000 (10:32 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 12 Jul 2017 17:08:28 +0000 (11:08 -0600)
include/deal.II/grid/tria.h
source/grid/tria.cc

index 80d8cbf20ec743701b3b6ade16575b455b3f19bd..fc26bb647fc41cc95382d740f26db7bd97542a2e 100644 (file)
@@ -1581,8 +1581,8 @@ public:
   /**
    * Copy constructor.
    *
-   * You should really use the @p copy_triangulation function, so we declare
-   * this function but let it throw an internal error. The reason for this is
+   * You should really use the @p copy_triangulation function, so this
+   * constructor is deleted. The reason for this is
    * that we may want to use triangulation objects in collections. However,
    * C++ containers require that the objects stored in them are copyable, so
    * we need to provide a copy constructor. On the other hand, copying
@@ -1593,7 +1593,7 @@ public:
    * Finally, through the exception, one easily finds the places where code
    * has to be changed to avoid copies.
    */
-  Triangulation (const Triangulation<dim, spacedim> &t);
+  Triangulation (const Triangulation<dim, spacedim> &) = delete;
 
   /**
    * Move constructor.
index 9b22a89875bd5a8a31a82be5f551f8c4fdccc178..cbd78a0b96997f8b78cc5a470c8da7a1b5c41ee8 100644 (file)
@@ -8968,25 +8968,6 @@ Triangulation (const MeshSmoothing smooth_grid,
 }
 
 
-template <int dim, int spacedim>
-Triangulation<dim, spacedim>::
-Triangulation (const Triangulation<dim, spacedim> &other)
-// do not set any subscriptors;
-// anyway, calling this constructor
-// is an error!
-  :
-  Subscriptor(),
-  signals (),
-  anisotropic_refinement(false),
-  check_for_distorted_cells(other.check_for_distorted_cells)
-{
-  Assert (false, ExcMessage ("You are not allowed to call this constructor "
-                             "because copying Triangulation objects is not "
-                             "allowed. Use Triangulation::copy_triangulation() "
-                             "instead."));
-}
-
-
 
 template <int dim, int spacedim>
 Triangulation<dim, spacedim>::

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.