From: bangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Mon, 26 Sep 2011 13:20:15 +0000 (+0000)
Subject: Add an assertion.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87417e078db7ce968211a947133fd21a5960162a;p=dealii-svn.git

Add an assertion.


git-svn-id: https://svn.dealii.org/trunk@24419 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/source/base/function.cc b/deal.II/source/base/function.cc
index ffaacd3db0..2ac7405647 100644
--- a/deal.II/source/base/function.cc
+++ b/deal.II/source/base/function.cc
@@ -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));
+}