From f86342e74bdb17e1d69f64c44fc3b25f07751e65 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 4 Jan 2012 10:53:57 +0000
Subject: [PATCH] Make constructors from FieldVector and std::array explicit.

This is safer, because calling the constructor implicitly
can lead to unwanted quaternion normalization.
(happened to me...)

[[Imported from SVN: r8344]]
---
 dune/gfe/rotation.hh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh
index f05cb2c2..6ddf2b1c 100644
--- a/dune/gfe/rotation.hh
+++ b/dune/gfe/rotation.hh
@@ -177,7 +177,7 @@ public:
         : Quaternion<T>(0,0,0,1)
     {}
     
-    Rotation<T,3>(const Dune::array<T,4>& c)
+    explicit Rotation<T,3>(const Dune::array<T,4>& c)
     {
         for (int i=0; i<4; i++)
             (*this)[i] = c[i];
@@ -185,7 +185,7 @@ public:
         *this /= this->two_norm();
     }
     
-    Rotation<T,3>(const Dune::FieldVector<T,4>& c)
+    explicit Rotation<T,3>(const Dune::FieldVector<T,4>& c)
         : Quaternion<T>(c)
     {
         *this /= this->two_norm();
-- 
GitLab