]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make copy operation explicit, rather than have the compiler generate the same code...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 02:27:46 +0000 (02:27 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 02:27:46 +0000 (02:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@12470 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/mapping_collection.h
deal.II/deal.II/source/fe/mapping_collection.cc

index 93ed6bdbb9f69b38b7a1b1a9ac904878d5177d6b..94c2198ce4198fe155447bd45980f2f01f5ef704 100644 (file)
@@ -22,6 +22,8 @@
 #include <boost/shared_ptr.hpp>
 
 
+//TODO[WB]: The conversion constructor should really be 'explicit'
+
 namespace hp
 {
 /**
@@ -70,6 +72,11 @@ namespace hp
                                         */
       MappingCollection (const Mapping<dim> &mapping);
 
+                                       /**
+                                        * Copy constructor.
+                                        */
+      MappingCollection (const MappingCollection<dim> &mapping_collection);
+      
                                        /**
                                         * Adds a new mapping to the
                                         * MappingCollection.  The
index 19456a5b95801d7239ba8306f3011f1b7d47c8f3..a19695dc8cde34f6b5a0a7449f3ea83d18fb7329 100644 (file)
@@ -20,18 +20,41 @@ namespace hp
 
   template <int dim>
   MappingCollection<dim>::MappingCollection ()
-  {
-  }
+  {}
 
 
+  
   template <int dim>
-  MappingCollection<dim>::MappingCollection (const Mapping<dim> &mapping)
+  MappingCollection<dim>::
+  MappingCollection (const Mapping<dim> &mapping)
   {
     mappings
       .push_back (boost::shared_ptr<const Mapping<dim> >(mapping.clone()));
   }
 
 
+
+  template <int dim>
+  MappingCollection<dim>::
+  MappingCollection (const MappingCollection<dim> &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 <int dim>
   inline
   const Mapping<dim> &

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.