Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67297 - sandbox/chrono/boost/static_integer
From: vicente.botet_at_[hidden]
Date: 2010-12-18 06:03:17


Author: viboes
Date: 2010-12-18 06:03:14 EST (Sat, 18 Dec 2010)
New Revision: 67297
URL: http://svn.boost.org/trac/boost/changeset/67297

Log:
StaticInteger cleanup
Text files modified:
   sandbox/chrono/boost/static_integer/static_abs.hpp | 24 ++++++++--------
   sandbox/chrono/boost/static_integer/static_gcd.hpp | 55 +++++++++++++++++++++------------------
   sandbox/chrono/boost/static_integer/static_lcm.hpp | 30 ++++++++++----------
   sandbox/chrono/boost/static_integer/static_sign.hpp | 26 +++++++++---------
   4 files changed, 70 insertions(+), 65 deletions(-)

Modified: sandbox/chrono/boost/static_integer/static_abs.hpp
==============================================================================
--- sandbox/chrono/boost/static_integer/static_abs.hpp (original)
+++ sandbox/chrono/boost/static_integer/static_abs.hpp 2010-12-18 06:03:14 EST (Sat, 18 Dec 2010)
@@ -33,20 +33,20 @@
 
 namespace integer
 {
- typedef boost::intmax_t static_abs_signed_type;
- typedef boost::uintmax_t static_abs_unsigned_type;
+ typedef boost::intmax_t static_abs_signed_type;
+ typedef boost::uintmax_t static_abs_unsigned_type;
 
- template <static_abs_signed_type X>
- struct static_signed_abs
- : integral_constant<static_abs_signed_type,
- X < 0 ? -X : X>
- {};
+ template <static_abs_signed_type X>
+ struct static_signed_abs
+ : integral_constant<static_abs_signed_type,
+ X < 0 ? -X : X>
+ {};
 
- template <static_abs_signed_type X>
- struct static_unsigned_abs
- : integral_constant<static_abs_unsigned_type,
- X < 0 ? -X : X>
- {};
+ template <static_abs_signed_type X>
+ struct static_unsigned_abs
+ : integral_constant<static_abs_unsigned_type,
+ X < 0 ? -X : X>
+ {};
 
 
 }

Modified: sandbox/chrono/boost/static_integer/static_gcd.hpp
==============================================================================
--- sandbox/chrono/boost/static_integer/static_gcd.hpp (original)
+++ sandbox/chrono/boost/static_integer/static_gcd.hpp 2010-12-18 06:03:14 EST (Sat, 18 Dec 2010)
@@ -34,32 +34,37 @@
 namespace integer
 {
 
- typedef boost::intmax_t static_gcd_signed_type;
- typedef boost::uintmax_t static_gcd_unsigned_type;
+ typedef boost::intmax_t static_gcd_signed_type;
+ typedef boost::uintmax_t static_gcd_unsigned_type;
 
- template <static_gcd_signed_type X, boost::intmax_t Y>
- struct static_signed_gcd
- : integral_constant<static_gcd_signed_type,
- static_signed_gcd<Y, X % Y>::value>
- {};
-
- template <static_gcd_signed_type X>
- struct static_signed_gcd<X, 0>
- : integral_constant<static_gcd_signed_type,
- X>
- {};
-
- template <static_gcd_unsigned_type X, boost::intmax_t Y>
- struct static_unsigned_gcd
- : integral_constant<static_gcd_unsigned_type,
- static_unsigned_gcd<Y, X % Y>::value>
- {};
-
- template <static_gcd_unsigned_type X>
- struct static_unsigned_gcd<X, 0>
- : integral_constant<static_gcd_signed_type,
- X>
- {};
+ template <static_gcd_signed_type X, boost::intmax_t Y>
+ struct static_signed_gcd
+ : static_signed_gcd<Y, X % Y>
+ {};
+
+ template <static_gcd_signed_type X>
+ struct static_signed_gcd<X, 0>
+ : integral_constant<static_gcd_signed_type,
+ X>
+ {};
+
+ template <static_gcd_signed_type X>
+ struct static_signed_gcd<0, X>
+ : integral_constant<static_gcd_signed_type,
+ X>
+ {};
+
+ template <static_gcd_unsigned_type X, boost::intmax_t Y>
+ struct static_unsigned_gcd
+ : integral_constant<static_gcd_unsigned_type,
+ static_unsigned_gcd<Y, X % Y>::value>
+ {};
+
+ template <static_gcd_unsigned_type X>
+ struct static_unsigned_gcd<X, 0>
+ : integral_constant<static_gcd_signed_type,
+ X>
+ {};
 }
 }
 

Modified: sandbox/chrono/boost/static_integer/static_lcm.hpp
==============================================================================
--- sandbox/chrono/boost/static_integer/static_lcm.hpp (original)
+++ sandbox/chrono/boost/static_integer/static_lcm.hpp 2010-12-18 06:03:14 EST (Sat, 18 Dec 2010)
@@ -34,22 +34,22 @@
 
 namespace integer
 {
- typedef boost::intmax_t static_lcm_signed_type;
- typedef boost::uintmax_t static_lcm_unsigned_type;
+ typedef boost::intmax_t static_lcm_signed_type;
+ typedef boost::uintmax_t static_lcm_unsigned_type;
 
- template <static_lcm_signed_type X, boost::intmax_t Y>
- struct static_signed_lcm
- : integral_constant<static_lcm_signed_type,
- X / static_signed_gcd<X, Y>::value * Y>
- {
- };
-
- template <static_lcm_unsigned_type X, boost::intmax_t Y>
- struct static_unsigned_lcm
- : integral_constant<static_lcm_unsigned_type,
- X / static_unsigned_gcd<X, Y>::value * Y>
- {
- };
+ template <static_lcm_signed_type X, boost::intmax_t Y>
+ struct static_signed_lcm
+ : integral_constant<static_lcm_signed_type,
+ X / static_signed_gcd<X, Y>::value * Y>
+ {
+ };
+
+ template <static_lcm_unsigned_type X, boost::intmax_t Y>
+ struct static_unsigned_lcm
+ : integral_constant<static_lcm_unsigned_type,
+ X / static_unsigned_gcd<X, Y>::value * Y>
+ {
+ };
 
 }
 }

Modified: sandbox/chrono/boost/static_integer/static_sign.hpp
==============================================================================
--- sandbox/chrono/boost/static_integer/static_sign.hpp (original)
+++ sandbox/chrono/boost/static_integer/static_sign.hpp 2010-12-18 06:03:14 EST (Sat, 18 Dec 2010)
@@ -33,20 +33,20 @@
 
 namespace integer
 {
- typedef boost::intmax_t static_sign_signed_type;
- typedef boost::intmax_t static_sign_unsigned_type;
+ typedef boost::intmax_t static_sign_signed_type;
+ typedef boost::intmax_t static_sign_unsigned_type;
 
- template <static_sign_signed_type X>
- struct static_signed_sign
- : integral_constant<static_sign_signed_type, X == 0 ? 0 : (X < 0 ? -1 : 1)>
- {
- };
-
- template <static_sign_unsigned_type X>
- struct static_unsigned_sign
- : integral_constant<static_sign_unsigned_type, X == 0 ? 0 : (X < 0 ? -1 : 1)>
- {
- };
+ template <static_sign_signed_type X>
+ struct static_signed_sign
+ : integral_constant<static_sign_signed_type, X == 0 ? 0 : (X < 0 ? -1 : 1)>
+ {
+ };
+
+ template <static_sign_unsigned_type X>
+ struct static_unsigned_sign
+ : integral_constant<static_sign_unsigned_type, X == 0 ? 0 : (X < 0 ? -1 : 1)>
+ {
+ };
 
 }
 }


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