From: maier Date: Sat, 10 Nov 2012 10:08:58 +0000 (+0000) Subject: Revert r27495 and do it properly X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86f3469180b5ac80b8fa9a236f130719d9ae748d;p=dealii-svn.git Revert r27495 and do it properly git-svn-id: https://svn.dealii.org/branches/branch_cmake@27498 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/point.h b/deal.II/include/deal.II/base/point.h index b247ce6cc7..b94c66b704 100644 --- a/deal.II/include/deal.II/base/point.h +++ b/deal.II/include/deal.II/base/point.h @@ -224,9 +224,12 @@ template inline Point::Point (const Number x) { - Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall()); - if(dim != 1) return; - this->values[0] = x; + switch(dim) { + case 1: + this->values[0] = x; + default: + Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall()); + } } @@ -235,10 +238,13 @@ template inline Point::Point (const Number x, const Number y) { - Assert (dim==2, StandardExceptions::ExcInvalidConstructorCall()); - if(dim != 2) return; - this->values[0] = x; - this->values[1] = y; + switch(dim) { + case 2: + this->values[0] = x; + this->values[1] = y; + default: + Assert (dim==2, StandardExceptions::ExcInvalidConstructorCall()); + } } @@ -247,11 +253,14 @@ template inline Point::Point (const Number x, const Number y, const Number z) { - Assert (dim==3, StandardExceptions::ExcInvalidConstructorCall()); - if(dim != 3) return; - this->values[0] = x; - this->values[1] = y; - this->values[2] = z; + switch(dim) { + case 3: + this->values[0] = x; + this->values[1] = y; + this->values[2] = z; + default: + Assert (dim==3, StandardExceptions::ExcInvalidConstructorCall()); + } }