]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an assertion.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 26 Sep 2011 13:20:15 +0000 (13:20 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 26 Sep 2011 13:20:15 +0000 (13:20 +0000)
git-svn-id: https://svn.dealii.org/trunk@24419 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/function.cc

index ffaacd3db074a7ebbf7e8ad7a798cfced8c18afb..2ac740564749766d245c5ee109cf350ef0d793ad 100644 (file)
@@ -452,7 +452,10 @@ ComponentSelectFunction (const unsigned int selected,
                :
                ConstantFunction<dim> (1., n_components),
                 selected_components(std::make_pair(selected,selected+1))
-{}
+{
+  Assert (selected < n_components,
+         ExcIndexRange (selected, 0, n_components));
+}
 
 
 

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.