From: Wolfgang Bangerth Date: Wed, 12 Jul 2017 16:32:52 +0000 (-0600) Subject: Delete the copy constructor of class Triangulation. X-Git-Tag: v9.0.0-rc1~1425^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fad4123aab6a546ea091c28c0b70c006736182c;p=dealii.git Delete the copy constructor of class Triangulation. --- diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 80d8cbf20e..fc26bb647f 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -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 &t); + Triangulation (const Triangulation &) = delete; /** * Move constructor. diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 9b22a89875..cbd78a0b96 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -8968,25 +8968,6 @@ Triangulation (const MeshSmoothing smooth_grid, } -template -Triangulation:: -Triangulation (const Triangulation &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 Triangulation::