From 6754e69a9cc43116c4a36b6453a8936263daa347 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 9 Sep 2007 00:14:51 +0000 Subject: [PATCH] Remove another workaround for gcc 2.95 (which we don't support any more). git-svn-id: https://svn.dealii.org/trunk@15171 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/tria.h | 33 ++++++----------------------- deal.II/deal.II/source/grid/tria.cc | 20 ++++++----------- 2 files changed, 13 insertions(+), 40 deletions(-) diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index ddedaad55c..e9fded62a2 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -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 *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 straight_boundary; /** * An internal typedef to make diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index a08764a636..1c790497f1 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -34,24 +34,18 @@ 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 dummy_straight_boundary; -} +template +const StraightBoundary +Triangulation::straight_boundary = StraightBoundary(); -template -const StraightBoundary * -Triangulation::straight_boundary = &dummy_straight_boundary; template const unsigned int Triangulation::dimension; + template Triangulation::Triangulation (const MeshSmoothing smooth_grid) : Subscriptor (), @@ -61,7 +55,7 @@ Triangulation::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 void Triangulation::set_boundary (const unsigned int number) { - set_boundary (number, *straight_boundary); + set_boundary (number, straight_boundary); } @@ -4924,7 +4918,7 @@ Triangulation::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(); } -- 2.39.5