Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67369 - sandbox/chrono/boost/ratio
From: vicente.botet_at_[hidden]
Date: 2010-12-20 12:54:41


Author: viboes
Date: 2010-12-20 12:54:40 EST (Mon, 20 Dec 2010)
New Revision: 67369
URL: http://svn.boost.org/trac/boost/changeset/67369

Log:
Ratio: Add constexpr
Text files modified:
   sandbox/chrono/boost/ratio/ratio.hpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: sandbox/chrono/boost/ratio/ratio.hpp
==============================================================================
--- sandbox/chrono/boost/ratio/ratio.hpp (original)
+++ sandbox/chrono/boost/ratio/ratio.hpp 2010-12-20 12:54:40 EST (Mon, 20 Dec 2010)
@@ -32,6 +32,7 @@
 #ifndef BOOST_RATIO_RATIO_HPP
 #define BOOST_RATIO_RATIO_HPP
 
+#include <boost/config.hpp>
 #include <boost/static_integer/static_abs.hpp>
 #include <boost/static_integer/static_sign.hpp>
 #include <boost/static_integer/static_gcd.hpp>
@@ -79,8 +80,8 @@
       * boost::integer::static_signed_sign<D>::value;
     static const boost::intmax_t GCD = boost::integer::static_signed_gcd<ABS_N, ABS_D>::value;
 public:
- static const boost::intmax_t num = SIGN_N * ABS_N / GCD;
- static const boost::intmax_t den = ABS_D / GCD;
+ BOOST_STATIC_CONSTEXPR boost::intmax_t num = SIGN_N * ABS_N / GCD;
+ BOOST_STATIC_CONSTEXPR boost::intmax_t den = ABS_D / GCD;
 
 #ifdef BOOST_RATIO_EXTENSIONS
     ratio()


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