Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77203 - trunk/boost/geometry/extensions/gis/geographic/strategies
From: barend.gehrels_at_[hidden]
Date: 2012-03-04 05:14:52


Author: barendgehrels
Date: 2012-03-04 05:14:50 EST (Sun, 04 Mar 2012)
New Revision: 77203
URL: http://svn.boost.org/trac/boost/changeset/77203

Log:
[geometry] Applied patch of Krzysztof Czainski to conditionally avoid using boost numeric cast.
Note: we will look for a more general approach later.
Text files modified:
   trunk/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp
==============================================================================
--- trunk/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp (original)
+++ trunk/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp 2012-03-04 05:14:50 EST (Sun, 04 Mar 2012)
@@ -38,7 +38,11 @@
 #include <string>
 
 #include <boost/static_assert.hpp>
+
+#if !defined(BOOST_GEOMETRY_NO_LEXICAL_CAST)
 #include <boost/lexical_cast.hpp>
+#endif // !defined(BOOST_GEOMETRY_NO_LEXICAL_CAST)
+
 #include <boost/algorithm/string.hpp>
 
 #include <boost/geometry/core/cs.hpp>
@@ -129,7 +133,11 @@
         template <size_t I>
         static inline void assign_dms(dms_value& dms, std::string& value, bool& has_value)
         {
+#if !defined(BOOST_GEOMETRY_NO_LEXICAL_CAST)
             dms.dms[I] = boost::lexical_cast<double>(value.c_str());
+#else // !defined(BOOST_GEOMETRY_NO_LEXICAL_CAST)
+ dms.dms[I] = std::atof(value.c_str());
+#endif // !defined(BOOST_GEOMETRY_NO_LEXICAL_CAST)
             dms.has_dms[I] = true;
             has_value = false;
             value.clear();


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