From c7650932cd4f149d0b231df665bbe5b9988eed7a Mon Sep 17 00:00:00 2001 From: kanschat Date: Sun, 13 Sep 2009 20:02:03 +0000 Subject: [PATCH] change behavior of size() git-svn-id: https://svn.dealii.org/trunk@19455 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/named_data.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deal.II/base/include/base/named_data.h b/deal.II/base/include/base/named_data.h index 84cdb07bca..9306d4b4df 100644 --- a/deal.II/base/include/base/named_data.h +++ b/deal.II/base/include/base/named_data.h @@ -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]; } -- 2.39.5