|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57269 - sandbox/numeric_adaptor/boost/numeric_adaptor
From: bruno.lalande_at_[hidden]
Date: 2009-11-01 03:46:21
Author: bruno.lalande
Date: 2009-11-01 03:46:20 EST (Sun, 01 Nov 2009)
New Revision: 57269
URL: http://svn.boost.org/trac/boost/changeset/57269
Log:
Conversion from string is now automatically deduced from conversion from char*. Removed constructors from string and char*.
Text files modified:
sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp | 22 ----------------------
sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp | 21 ---------------------
sandbox/numeric_adaptor/boost/numeric_adaptor/numeric_adaptor.hpp | 8 ++++++++
3 files changed, 8 insertions(+), 43 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-11-01 03:46:20 EST (Sun, 01 Nov 2009)
@@ -45,19 +45,6 @@
m_value = cln::cl_float(v, cln::float_format(256));
}
- cln_value_type(char const* s)
- : m_value(cln::cl_float(0.0, cln::float_format(256)))
- {
- // Conversions from `const char *' are provided [...]
- m_value = s;
- }
-
- cln_value_type(std::string const& s)
- : m_value(cln::cl_float(0.0, cln::float_format(256)))
- {
- m_value = s.c_str();
- }
-
cln_value_type(cln::cl_F const& v)
: m_value(v)
@@ -152,15 +139,6 @@
}
};
-template <>
-struct to_traits<cln_value_type, std::string>
-{
- static cln_value_type apply(const std::string& source)
- {
- return to_traits<cln_value_type, const char*>::apply(source.c_str());
- }
-};
-
} // namespace numeric_adaptor
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-11-01 03:46:20 EST (Sun, 01 Nov 2009)
@@ -37,18 +37,6 @@
mpf_set_d(m_value, v);
}
- gmp_value_type(char const* s)
- {
- mpf_init(m_value);
- mpf_set_str(m_value, s, 10);
- }
-
- gmp_value_type(std::string const& s)
- {
- mpf_init(m_value);
- mpf_set_str(m_value, s.c_str(), 10);
- }
-
gmp_value_type(mpf_t& v)
{
@@ -191,15 +179,6 @@
}
};
-template <>
-struct to_traits<gmp_value_type, std::string>
-{
- static gmp_value_type apply(const std::string& source)
- {
- return to_traits<gmp_value_type, const char*>::apply(source.c_str());
- }
-};
-
} // namespace numeric_adaptor
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-11-01 03:46:20 EST (Sun, 01 Nov 2009)
@@ -15,6 +15,7 @@
#include <cmath>
+#include <string>
#include <boost/static_assert.hpp>
#include <boost/math/special_functions/hypot.hpp>
#include <boost/lexical_cast.hpp>
@@ -33,6 +34,13 @@
{ return boost::lexical_cast<Target>(source); }
};
+template <class Target>
+struct to_traits<Target, std::string>
+{
+ static Target apply(const std::string& source)
+ { return to_traits<Target, const char*>::apply(source.c_str()); }
+};
+
} // namespace numeric_adaptor
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