Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56447 - sandbox/numeric_adaptor/boost/numeric_adaptor
From: barend.gehrels_at_[hidden]
Date: 2009-09-27 17:11:39


Author: barendgehrels
Date: 2009-09-27 17:11:38 EDT (Sun, 27 Sep 2009)
New Revision: 56447
URL: http://svn.boost.org/trac/boost/changeset/56447

Log:
Added default constructor (CLN) and assignment operator (GMP)
Text files modified:
   sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp | 5 +++--
   sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp | 10 ++++++++++
   2 files changed, 13 insertions(+), 2 deletions(-)

Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp 2009-09-27 17:11:38 EDT (Sun, 27 Sep 2009)
@@ -28,6 +28,7 @@
 struct cln_value_type //: public default_value_type<cln_policy, cln::cl_F>
 {
     cln_value_type()
+ : m_value(cln::cl_float(0.0, cln::float_format(256)))
     {}
 
     cln_value_type(double v)
@@ -37,8 +38,8 @@
         m_value = cln::cl_float(v, cln::float_format(256));
     }
 
- cln_value_type(cln::cl_F const& v):
- m_value(v)
+ cln_value_type(cln::cl_F const& v)
+ : m_value(v)
     {}
 
     operator double() const

Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp 2009-09-27 17:11:38 EDT (Sun, 27 Sep 2009)
@@ -42,6 +42,16 @@
         mpf_set(m_value, other.m_value);
     }
 
+ void operator =( gmp_value_type const& other)
+ {
+ // Copy value if not self-assignment
+ if (this != &other)
+ {
+ mpf_set(m_value, other.m_value);
+ }
+ }
+
+
     ~gmp_value_type()
     {
         mpf_clear(m_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