Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67906 - trunk/boost/ratio
From: vicente.botet_at_[hidden]
Date: 2011-01-10 02:22:24


Author: viboes
Date: 2011-01-10 02:22:19 EST (Mon, 10 Jan 2011)
New Revision: 67906
URL: http://svn.boost.org/trac/boost/changeset/67906

Log:
Boost.Ratio: Add static const instances num/den when constexpr is not available

Text files modified:
   trunk/boost/ratio/ratio.hpp | 7 +++++++
   1 files changed, 7 insertions(+), 0 deletions(-)

Modified: trunk/boost/ratio/ratio.hpp
==============================================================================
--- trunk/boost/ratio/ratio.hpp (original)
+++ trunk/boost/ratio/ratio.hpp 2011-01-10 02:22:19 EST (Mon, 10 Jan 2011)
@@ -119,6 +119,13 @@
     typedef ratio<num, den> type;
 };
 
+#if defined(BOOST_NO_CONSTEXPR)
+template <boost::intmax_t N, boost::intmax_t D>
+const boost::intmax_t ratio<N, D>::num;
+template <boost::intmax_t N, boost::intmax_t D>
+const boost::intmax_t ratio<N, D>::den;
+#endif
+
 //----------------------------------------------------------------------------//
 // //
 // 20.6.2 Arithmetic on ratio types [ratio.arithmetic] //


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