]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Clean up some quirks of gcc 2.7; introduce new ones of gcc 2.8
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 23 Mar 1998 12:30:35 +0000 (12:30 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 23 Mar 1998 12:30:35 +0000 (12:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@93 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Todo
deal.II/deal.II/include/grid/tria_iterator.h
deal.II/deal.II/include/numerics/data_io.h
deal.II/deal.II/source/grid/tria.cc
deal.II/deal.II/source/numerics/data_io.cc

index 4086d29f8fcbacb2b0ca5f2a480fc6a43a3d2296..b0d40ed8f4befdd2989b137232f9ef70170aede8 100644 (file)
@@ -1,12 +1,6 @@
 Replace the declaration of vector<bool> in tria.h by something real
   when gcc2.8 is available
 
-Make some functions in the iterators inlined, if the compiler
-  accepts them in gcc2.8
-
-Make the iterator functions (begin_*, end) templated with gcc2.8,
-  let the dimension then be templated (gcc2.8 chokes ober the return
-  type)
 
 Rewrite code like
       int flagged_cells = 0;
index 1d14bf0c60df603873c6be33ddc6f6be9ed31665..5eecf0e47282ab20f89c3cac899448b1ecdebc53 100644 (file)
@@ -267,23 +267,13 @@ class TriaRawIterator : public bidirectional_iterator<Accessor,int>{
                                      *  You must not dereference invalid or
                                      *  past the end iterators.
                                      */
-    const Accessor & operator * () const {
-                                      // put this function here, since we can't
-                                      // inline it with gcc 2.7
-      Assert (state() == valid, ExcDereferenceInvalidObject());
-      return accessor;
-    };
-
+    const Accessor & operator * () const;
+    
                                     /**
                                      *  Dereferencing operator, non-#const#
                                      *  version.
                                      */
-    Accessor & operator * () {
-                                      // put this function here, since we can't
-                                      // inline it with gcc 2.7
-      Assert (state() == valid, ExcDereferenceInvalidObject());
-      return accessor;
-    };
+    Accessor & operator * ();
         
                                     /**
                                      *  Dereferencing operator, returns a
@@ -293,22 +283,13 @@ class TriaRawIterator : public bidirectional_iterator<Accessor,int>{
                                      *  There is a #const# and a non-#const#
                                      *  version.
                                      */
-    const Accessor * operator -> () const {
-                                      // put this function here, since we can't
-                                      // inline it with gcc 2.7
-      return &(this->operator* ());
-    };
-      
-    
+    const Accessor * operator -> () const;
+        
                                     /**
                                      *  Dereferencing operator, non-#const#
                                      *  version.
                                      */
-    Accessor * operator -> () {
-                                      // put this function here, since we can't
-                                      // inline it with gcc 2.7
-      return &(this->operator* ());
-    };
+    Accessor * operator -> ();
                                     /*@}*/
     
                                     /**
@@ -417,7 +398,7 @@ class TriaRawIterator : public bidirectional_iterator<Accessor,int>{
                                      */
     DeclException0 (ExcAdvanceInvalidObject);
                                     /*@}*/
-//  protected:  // don't know why we can't declare this protected (gcc2.7 chokes!?)
+//  protected:  // don't know why we can't declare this protected (gcc2.7/8 chokes!?)
     Accessor accessor;
 };
 
@@ -678,6 +659,52 @@ class TriaActiveIterator : public TriaIterator<dim,Accessor> {
 
 
 
+
+
+/*----------------------- Inline functions -------------------*/
+
+
+
+template <int dim, class Accessor>
+inline
+const Accessor &
+TriaRawIterator<dim,Accessor>::operator * () const {
+  Assert (state() == valid, ExcDereferenceInvalidObject());
+  return accessor;
+};
+
+
+
+
+template <int dim, class Accessor>
+inline
+Accessor &
+TriaRawIterator<dim,Accessor>::operator * () {
+  Assert (state() == valid, ExcDereferenceInvalidObject());
+  return accessor;
+};
+
+
+
+template <int dim, class Accessor>
+inline
+const Accessor *
+TriaRawIterator<dim,Accessor>::operator -> () const {
+  return &(this->operator* ());
+};
+
+
+
+template <int dim, class Accessor>
+inline
+Accessor *
+TriaRawIterator<dim,Accessor>::operator -> () {
+  return &(this->operator* ());
+};
+
+
+
+
 template <int dim, class Accessor>
 inline
 IteratorState TriaRawIterator<dim,Accessor>::state () const {
@@ -717,6 +744,8 @@ ostream & operator << (ostream &out, const TriaRawIterator<dim,Accessor> &i) {
   return out;
 };
 
+
+
 template <int dim, class Accessor>
 inline
 ostream & operator << (ostream &out, const TriaIterator<dim,Accessor> &i) {
@@ -724,6 +753,8 @@ ostream & operator << (ostream &out, const TriaIterator<dim,Accessor> &i) {
   return out;
 };
 
+
+
 template <int dim, class Accessor>
 inline
 ostream & operator << (ostream &out, const TriaActiveIterator<dim,Accessor> &i) {
index b55ea675ecc1ca9299a40a100667ec044bd2b76b..b80676e5631ad92d3de1d169f5081c12550a348f 100644 (file)
@@ -330,23 +330,13 @@ class DataOut {
                                          * invalid object, but is needed for
                                          * the STL classes.
                                          */
-       DataEntry () :
-                                                        // don't know why we have
-                                                        // to define here, gcc2.8
-                                                        // should be able to handle
-                                                        // this in the .cc file
-                       data(0), name(""), units("") {};
+       DataEntry ();
                        
                                         /**
                                          * Constructor
                                          */
-       DataEntry (const dVector *data, const String name, const String units) :
-                                                        // don't know why we have
-                                                        // to define here, gcc2.8
-                                                        // should be able to handle
-                                                        // this in the .cc file
-                       data(data), name(name), units(units) {};
-
+       DataEntry (const dVector *data, const String name, const String units);
+       
                                         /**
                                          * Pointer to the data vector.
                                          */
index d19912d9629431b67049cf82453b2503924ccb07..2d0b3ba87de0a2a079e5f363474f2302687332b3 100644 (file)
@@ -1443,13 +1443,8 @@ unsigned int Triangulation<dim>::max_adjacent_cells () const {
     for (unsigned vertex=0; vertex<(1<<dim); ++vertex)
       ++usage_count[cell->vertex_index(vertex)];
 
-                                  // use max(.,.) when gcc2.8 is available
-  const unsigned short int max_entry =  *(max_element (usage_count.begin(),
-                                                      usage_count.end()));
-  if (max_entry > (1<<dim))
-    return max_entry;
-  else
-    return (1<<dim);
+  return max ((unsigned int)1<<dim,
+             (unsigned int)*(max_element (usage_count.begin(),usage_count.end())));
 };
 
 
index 493d6715c4ca568d6bbf2126d2181c8f92619b30..63d2417ca70bda79c4a26aa8f1254d615907ab2f 100644 (file)
@@ -128,6 +128,21 @@ void DataIn<dim>::read_ucd (istream &in) {
 
 
 
+template <int dim>
+DataOut<dim>::DataEntry::DataEntry () :
+               data(0), name(""), units("") {};
+
+
+
+template <int dim>
+DataOut<dim>::DataEntry::DataEntry (const dVector *data,
+                                   const String name,
+                                   const String units) :
+                       data(data), name(name), units(units) {};
+
+
+
+
 template <int dim>
 DataOut<dim>::DataOut () :
                dofs(0) {};

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.