Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70569 - trunk/boost/math
From: john_at_[hidden]
Date: 2011-03-26 08:04:02


Author: johnmaddock
Date: 2011-03-26 08:04:02 EDT (Sat, 26 Mar 2011)
New Revision: 70569
URL: http://svn.boost.org/trac/boost/changeset/70569

Log:
Cast arguments to quaternion/octonion constructors so they still work when there's no implicit conversion available.
Fixes #5369.
Text files modified:
   trunk/boost/math/octonion.hpp | 4 ++--
   trunk/boost/math/quaternion.hpp | 4 ++--
   2 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/boost/math/octonion.hpp
==============================================================================
--- trunk/boost/math/octonion.hpp (original)
+++ trunk/boost/math/octonion.hpp 2011-03-26 08:04:02 EDT (Sat, 26 Mar 2011)
@@ -4713,11 +4713,11 @@
             }
             else if (n == 0)
             {
- return(octonion<T>(1));
+ return(octonion<T>(static_cast<T>(1)));
             }
             else /* n < 0 */
             {
- return(pow(octonion<T>(1)/o,-n));
+ return(pow(octonion<T>(static_cast<T>(1))/o,-n));
             }
         }
         

Modified: trunk/boost/math/quaternion.hpp
==============================================================================
--- trunk/boost/math/quaternion.hpp (original)
+++ trunk/boost/math/quaternion.hpp 2011-03-26 08:04:02 EDT (Sat, 26 Mar 2011)
@@ -1887,11 +1887,11 @@
             }
             else if (n == 0)
             {
- return(quaternion<T>(1));
+ return(quaternion<T>(static_cast<T>(1)));
             }
             else /* n < 0 */
             {
- return(pow(quaternion<T>(1)/q,-n));
+ return(pow(quaternion<T>(static_cast<T>(1))/q,-n));
             }
         }
         


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk