]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
change behavior of size()
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 13 Sep 2009 20:02:03 +0000 (20:02 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 13 Sep 2009 20:02:03 +0000 (20:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@19455 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/named_data.h

index 84cdb07bcad7da1724124e71f0258dee6eaf85fa..9306d4b4dfa6ea36e309340d683152a33bbe3dc9 100644 (file)
@@ -174,7 +174,9 @@ class NamedSelection
 
                                     /**
                                      * The number of names in this
-                                     * object.
+                                     * object. This function may be
+                                     * used whether initialize() was
+                                     * called before or not.
                                      */
     unsigned int size() const;
     
@@ -182,7 +184,9 @@ class NamedSelection
                                      * Return the corresponding index
                                      * in the NamedData object
                                      * supplied to the last
-                                     * initialize().
+                                     * initialize(). It is an error
+                                     * if initialize() has not been
+                                     * called before.
                                      *
                                      * Indices are in the same order
                                      * as the calls to add().
@@ -364,7 +368,6 @@ inline
 unsigned int
 NamedSelection::size() const
 {
-  Assert (indices.size() == names.size(), ExcNotInitialized());
   return names.size();
 }
 
@@ -373,6 +376,7 @@ inline
 unsigned int
 NamedSelection::operator() (unsigned int i) const
 {
+  Assert (indices.size() == names.size(), ExcNotInitialized());
   AssertIndexRange(i, size());  
   return indices[i];
 }

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.