Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73919 - trunk/boost/ratio/detail
From: vicente.botet_at_[hidden]
Date: 2011-08-19 11:41:09


Author: viboes
Date: 2011-08-19 11:41:08 EDT (Fri, 19 Aug 2011)
New Revision: 73919
URL: http://svn.boost.org/trac/boost/changeset/73919

Log:
ratio: fix #5724: 0 + 0 and 0 - 0 lead to a compile time error
Text files modified:
   trunk/boost/ratio/detail/overflow_helpers.hpp | 15 +++++++++++++--
   1 files changed, 13 insertions(+), 2 deletions(-)

Modified: trunk/boost/ratio/detail/overflow_helpers.hpp
==============================================================================
--- trunk/boost/ratio/detail/overflow_helpers.hpp (original)
+++ trunk/boost/ratio/detail/overflow_helpers.hpp 2011-08-19 11:41:08 EDT (Fri, 19 Aug 2011)
@@ -242,7 +242,12 @@
>
>::type type;
   };
-
+ template <class R>
+ struct ratio_add<R, ratio<0> >
+ {
+ typedef R type;
+ };
+
   template <class R1, class R2>
   struct ratio_subtract
   {
@@ -268,7 +273,13 @@
>
>::type type;
   };
-
+
+ template <class R>
+ struct ratio_subtract<R, ratio<0> >
+ {
+ typedef R type;
+ };
+
   template <class R1, class R2>
   struct ratio_multiply
   {


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