]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove another workaround for gcc 2.95 (which we don't support any more).
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Sep 2007 00:14:51 +0000 (00:14 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Sep 2007 00:14:51 +0000 (00:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@15171 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/source/grid/tria.cc

index ddedaad55ceeae91d39e4f57d0a05c5f45b0e980..e9fded62a2da217b46d6544850c9e1b00a99eed2 100644 (file)
@@ -1142,33 +1142,12 @@ class Triangulation : public Subscriptor
 {
   private:
                                     /**
-                                     * Default boundary object. This
-                                     * declaration is used for the
-                                     * default argument in
-                                     * @p set_boundary.
-                                     *
-                                     * The proper way would have been
-                                     * to use a static object here,
-                                     * rather than a pointer to an
-                                     * object. However, we have to
-                                     * work around a bug in gcc2.95,
-                                     * where the compiler tries to
-                                     * instantiate @p Triangulation
-                                     * while instantiating
-                                     * @p Boundary (which it needs
-                                     * to do, since local typedefs
-                                     * are involved), but then tries
-                                     * to in turn instantiate
-                                     * @p StraightBoundary because
-                                     * of this member variable. This
-                                     * is not needed since the member
-                                     * variable is a static one, but
-                                     * the compiler tries anyway and
-                                     * finds that it can't since the
-                                     * base class @p Boundary is not
-                                     * yet complete...
-                                     */
-    static const StraightBoundary<dim> *straight_boundary;
+                                     * Default boundary object. This is used
+                                     * for those boundaries for which no
+                                     * boundary object has been explicitly
+                                     * set using set_boundary().
+                                     */
+    static const StraightBoundary<dim> straight_boundary;
 
                                     /**
                                      * An internal typedef to make
index a08764a6362fcdf067b42ec14eb32e05cccd863d..1c790497f1299713c2ed054a07cae6b7f0544468 100644 (file)
 
 DEAL_II_NAMESPACE_OPEN
 
-// initialize the @p{straight_boundary} pointer of the triangulation
-// class. for the reasons why it is done like this, see the
-// documentation of that member variable
-namespace 
-{
-  const StraightBoundary<deal_II_dimension> dummy_straight_boundary;
-}
+template <int dim>
+const StraightBoundary<dim>
+Triangulation<dim>::straight_boundary = StraightBoundary<dim>();
 
 
-template <int dim>
-const StraightBoundary<dim> *
-Triangulation<dim>::straight_boundary = &dummy_straight_boundary;
 
 template <int dim>
 const unsigned int
 Triangulation<dim>::dimension;
 
 
+
 template <int dim>
 Triangulation<dim>::Triangulation (const MeshSmoothing smooth_grid) :
                Subscriptor (),
@@ -61,7 +55,7 @@ Triangulation<dim>::Triangulation (const MeshSmoothing smooth_grid) :
                                   // set default boundary for all
                                   // possible components
   for (unsigned int i=0;i<255;++i)
-    boundary[i] = straight_boundary;
+    boundary[i] = &straight_boundary;
 }
 
 
@@ -110,7 +104,7 @@ template <int dim>
 void
 Triangulation<dim>::set_boundary (const unsigned int number)
 {
-  set_boundary (number, *straight_boundary);
+  set_boundary (number, straight_boundary);
 }
 
 
@@ -4924,7 +4918,7 @@ Triangulation<dim>::clear_despite_subscriptions()
   vertices_used.clear ();
   
   for (unsigned int i=0; i<255; ++i)
-    boundary[i] = straight_boundary;
+    boundary[i] = &straight_boundary;
   
   number_cache = internal::Triangulation::NumberCache<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.