From 463d359f8df93b4325fec0f770f7e3758a18f6b3 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 15 Nov 2006 19:05:32 +0000 Subject: [PATCH] Update comment. git-svn-id: https://svn.dealii.org/trunk@14197 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/tria.h | 42 ++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 7b0ed29f31..25ad6e805b 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1288,18 +1288,36 @@ class Triangulation : public Subscriptor Triangulation (const MeshSmoothing smooth_grid = none); /** - * 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 that we may use - * triangulation objects in collection, - * but inside them sometimes strange - * operations like copying happen which - * should be avoided for objects as - * large as triangulations. By throwing - * an error, one easily finds these - * places and can find other ways. + * 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 + * 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 triangulations + * is so expensive that we do + * not want such objects copied + * by accident, for example in + * compiler-generated temporary + * objects. By defining a copy + * constructor but throwing an + * error, we satisfy the formal + * requirements of containers, + * but at the same time disallow + * actual copies. Finally, + * through the exception, one + * easily finds the places where + * code has to be changed to + * avoid copies. */ Triangulation (const Triangulation &t); -- 2.39.5