]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change the way we want to enquire the dimension of a point.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 1 Nov 1998 22:23:49 +0000 (22:23 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 1 Nov 1998 22:23:49 +0000 (22:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@619 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/point.h

index 2d76838a93a23943320073b5e235a733b2fa1115..28ad47a0e5f3a1f899c3c0720a71a11b7fe3a49e 100644 (file)
@@ -34,7 +34,22 @@ template <int dim>
 class Point {
   public:
                                     /**
-                                     *  Constructor. Initialize all entries
+                                     * Provide a way to get the dimension of
+                                     * an object without explicit knowledge
+                                     * of it's data type. Implementation is
+                                     * this way instead of providing a function
+                                     * #dimension()# because now it is possible
+                                     * to get the dimension at compile time
+                                     * without the expansion and preevaluation
+                                     * of an inlined function; the compiler may
+                                     * therefore produce more efficient code
+                                     * and you may use this value to declare
+                                     * other data types.
+                                     */
+    static const unsigned int dimension = dim;
+    
+                                    /**
+                                     * Constructor. Initialize all entries
                                      * to zero.
                                      */
     explicit Point ();
@@ -67,12 +82,6 @@ class Point {
                                      */
     Point (const Point<dim> &);
 
-                                    /**
-                                     *  Return the dimension of the space this
-                                     *  point is living in.
-                                     */
-    unsigned int dimension() const { return dim; };
-    
                                     /**
                                      *  Read access to the #index#th coordinate.
                                      */

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.