From: Matthias Maier Date: Thu, 3 Sep 2015 05:54:41 +0000 (+0200) Subject: Bugfix: Avoid C++11 features X-Git-Tag: v8.4.0-rc2~466^2~22 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75fa32760332e22fb5f1907a6ddaa3711de94fb2;p=dealii.git Bugfix: Avoid C++11 features Do not use template default arguments for function templates. Also provide fully templated interface for scalar multiplication with point, too. --- diff --git a/include/deal.II/base/point.h b/include/deal.II/base/point.h index a51b5678a3..723a339a8e 100644 --- a/include/deal.II/base/point.h +++ b/include/deal.II/base/point.h @@ -199,15 +199,16 @@ public: * * @relates EnableIfScalar */ - template ::type> - Point operator * (const OtherNumber) const; + template + Point::type>::type> + operator * (const OtherNumber) const; /** * Divide the current point by a factor. */ - template - Point operator / (const OtherNumber) const; + template + Point::type>::type> + operator / (const OtherNumber) const; /** * Return the scalar product of the vectors representing two points. @@ -396,13 +397,28 @@ Point::operator - () const template -template +template inline -Point +Point::type>::type> Point::operator * (const OtherNumber factor) const { - Point tmp = *this; - tmp *= factor; + Point::type> tmp; + for (unsigned int i=0; ioperator[](i) * factor; + return tmp; +} + + + +template +template +inline +Point::type>::type> +Point::operator / (const OtherNumber factor) const +{ + Point::type> tmp; + for (unsigned int i=0; ioperator[](i) / factor; return tmp; } @@ -450,18 +466,6 @@ Point::distance (const Point &p) const -template -template -inline -Point Point::operator / (const OtherNumber factor) const -{ - Point tmp = *this; - tmp /= factor; - return tmp; -} - - - template template inline @@ -485,13 +489,11 @@ Point::serialize(Archive &ar, const unsigned int) * @relates Point * @relates EnableIfScalar */ -template ::type> +template inline -Point operator * (const OtherNumber factor, - const Point &p) +Point::type>::type> +operator * (const OtherNumber factor, + const Point &p) { return p * factor; }