|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53518 - sandbox/numeric_adaptor/boost/numeric_adaptor
From: bruno.lalande_at_[hidden]
Date: 2009-05-31 18:41:09
Author: bruno.lalande
Date: 2009-05-31 18:41:08 EDT (Sun, 31 May 2009)
New Revision: 53518
URL: http://svn.boost.org/trac/boost/changeset/53518
Log:
Changed type into value_type for the policy underlying type.
Text files modified:
sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp | 2 +-
sandbox/numeric_adaptor/boost/numeric_adaptor/default_policy.hpp | 29 +++++++++++++++++++----------
sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp | 2 +-
sandbox/numeric_adaptor/boost/numeric_adaptor/numeric_adaptor.hpp | 28 ++++++++++++++--------------
4 files changed, 35 insertions(+), 26 deletions(-)
Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp 2009-05-31 18:41:08 EDT (Sun, 31 May 2009)
@@ -30,7 +30,7 @@
*/
struct cln_policy : public default_policy<cln::cl_F>
{
- typedef cln::cl_F type;
+ typedef cln::cl_F value_type;
template <typename FromType>
static inline void set(type& value, FromType const& v)
Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/default_policy.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/default_policy.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/default_policy.hpp 2009-05-31 18:41:08 EDT (Sun, 31 May 2009)
@@ -20,7 +20,7 @@
template <typename T>
struct default_policy
{
- typedef T type;
+ typedef T value_type;
// Default no initialization or pre-destruction is necessary
static inline void init(T& value) {}
@@ -30,15 +30,24 @@
static inline void copy(T const& source, T& dest) { dest = source; }
// The default policy uses the default operators +, -, *, /
- static inline void add(type& r, const type& a, const type& b) { r = a + b; }
- static inline void add(type& a, const type& b) { a += b; }
- static inline void subtract(type& r, const type& a, const type& b) { r = a - b; }
- static inline void subtract(type& a, const type& b) { a -= b; }
- static inline void multiply(type& r, const type& a, const type& b) { r = a * b; }
- static inline void multiply(type& a, const type& b) { a *= b; }
- static inline void divide(type& r, const type& a, const type& b) { r = a / b; }
- static inline void divide(type& a, const type& b) { a /= b; }
- static inline void neg(type& r, const type& n) { r = -n; }
+ static inline void add(value_type& r, const value_type& a, const value_type& b)
+ { r = a + b; }
+ static inline void add(value_type& a, const value_type& b)
+ { a += b; }
+ static inline void subtract(value_type& r, const value_type& a, const value_type& b)
+ { r = a - b; }
+ static inline void subtract(value_type& a, const value_type& b)
+ { a -= b; }
+ static inline void multiply(value_type& r, const value_type& a, const value_type& b)
+ { r = a * b; }
+ static inline void multiply(value_type& a, const value_type& b)
+ { a *= b; }
+ static inline void divide(value_type& r, const value_type& a, const value_type& b)
+ { r = a / b; }
+ static inline void divide(value_type& a, const value_type& b)
+ { a /= b; }
+ static inline void neg(value_type& r, const value_type& n)
+ { r = -n; }
// Default use the comparison operators
static inline int compare(T const& a, T const& b)
Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp 2009-05-31 18:41:08 EDT (Sun, 31 May 2009)
@@ -22,7 +22,7 @@
struct gmp_policy
{
- typedef mpf_t type;
+ typedef mpf_t value_type;
static inline void init(type& value)
{
Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/numeric_adaptor.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/numeric_adaptor.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/numeric_adaptor.hpp 2009-05-31 18:41:08 EDT (Sun, 31 May 2009)
@@ -128,7 +128,7 @@
numeric_adaptor<Policy> const& a,
numeric_adaptor<Policy> const& b)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::add(r, a.value, b.value);
return numeric_adaptor<Policy>(r, true);
@@ -144,7 +144,7 @@
numeric_adaptor<Policy> const& a,
numeric_adaptor<Policy> const& b)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::multiply(r, a.value, b.value);
return numeric_adaptor<Policy>(r, true);
@@ -160,7 +160,7 @@
numeric_adaptor<Policy> const& a,
numeric_adaptor<Policy> const& b)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::subtract(r, a.value, b.value);
return numeric_adaptor<Policy>(r, true);
@@ -176,7 +176,7 @@
numeric_adaptor<Policy> const& a,
numeric_adaptor<Policy> const& b)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::divide(r, a.value, b.value);
return numeric_adaptor<Policy>(r, true);
@@ -190,7 +190,7 @@
friend inline numeric_adaptor<Policy> operator-(numeric_adaptor<Policy> const& n)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::neg(r, n.value);
return numeric_adaptor<Policy>(r, true);
@@ -199,7 +199,7 @@
// Functions
static inline numeric_adaptor<Policy> abs(numeric_adaptor<Policy> const& v)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::abs(r, v.value);
return numeric_adaptor<Policy>(r, true);
@@ -207,7 +207,7 @@
static inline numeric_adaptor<Policy> sqrt(numeric_adaptor<Policy> const& v)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::sqrt(r, v.value);
return numeric_adaptor<Policy>(r, true);
@@ -215,7 +215,7 @@
static inline numeric_adaptor<Policy> cos(numeric_adaptor<Policy> const& v)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::cos(r, v.value);
return numeric_adaptor<Policy>(r, true);
@@ -223,7 +223,7 @@
static inline numeric_adaptor<Policy> sin(numeric_adaptor<Policy> const& v)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::sin(r, v.value);
return numeric_adaptor<Policy>(r, true);
@@ -231,7 +231,7 @@
static inline numeric_adaptor<Policy> tan(numeric_adaptor<Policy> const& v)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::tan(r, v.value);
return numeric_adaptor<Policy>(r, true);
@@ -239,7 +239,7 @@
static inline numeric_adaptor<Policy> atan(numeric_adaptor<Policy> const& v)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::atan(r, v.value);
return numeric_adaptor<Policy>(r, true);
@@ -249,7 +249,7 @@
static inline numeric_adaptor<Policy> hypot(numeric_adaptor<Policy> const& a,
numeric_adaptor<Policy> const& b)
{
- typename Policy::type r;
+ typename Policy::value_type r;
Policy::init(r);
Policy::hypot(r, a.value, b.value);
return numeric_adaptor<Policy>(r, true);
@@ -257,11 +257,11 @@
private :
- typename Policy::type value;
+ typename Policy::value_type value;
// Construct from a policy-type. Bool (or any other signature changing parameter)
// is necessary for cases where type == OtherType
- inline numeric_adaptor<Policy>(typename Policy::type const& v, bool)
+ inline numeric_adaptor<Policy>(typename Policy::value_type const& v, bool)
{
Policy::init(value);
Policy::copy(v, value);
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