From cc582d797d5ad25e1cbbc8f78bc58e85a4e88c93 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 23 Feb 2006 02:27:46 +0000 Subject: [PATCH] Make copy operation explicit, rather than have the compiler generate the same code implicitly git-svn-id: https://svn.dealii.org/trunk@12470 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/fe/mapping_collection.h | 7 +++++ .../deal.II/source/fe/mapping_collection.cc | 29 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/deal.II/deal.II/include/fe/mapping_collection.h b/deal.II/deal.II/include/fe/mapping_collection.h index 93ed6bdbb9..94c2198ce4 100644 --- a/deal.II/deal.II/include/fe/mapping_collection.h +++ b/deal.II/deal.II/include/fe/mapping_collection.h @@ -22,6 +22,8 @@ #include +//TODO[WB]: The conversion constructor should really be 'explicit' + namespace hp { /** @@ -70,6 +72,11 @@ namespace hp */ MappingCollection (const Mapping &mapping); + /** + * Copy constructor. + */ + MappingCollection (const MappingCollection &mapping_collection); + /** * Adds a new mapping to the * MappingCollection. The diff --git a/deal.II/deal.II/source/fe/mapping_collection.cc b/deal.II/deal.II/source/fe/mapping_collection.cc index 19456a5b95..a19695dc8c 100644 --- a/deal.II/deal.II/source/fe/mapping_collection.cc +++ b/deal.II/deal.II/source/fe/mapping_collection.cc @@ -20,18 +20,41 @@ namespace hp template MappingCollection::MappingCollection () - { - } + {} + template - MappingCollection::MappingCollection (const Mapping &mapping) + MappingCollection:: + MappingCollection (const Mapping &mapping) { mappings .push_back (boost::shared_ptr >(mapping.clone())); } + + template + MappingCollection:: + MappingCollection (const MappingCollection &mapping_collection) + : + Subscriptor (), + // copy the array + // of shared + // pointers. nothing + // bad should + // happen -- they + // simply all point + // to the same + // objects, and the + // last one to die + // will delete the + // mappings + mappings (mapping_collection.mappings) + {} + + + template inline const Mapping & -- 2.39.5