[geometry] Applied patch of Krzysztof Czainski to conditionally avoid using boost numeric cast.

Note: we will look for a more general approach later.

[SVN r77203]
This commit is contained in:
Barend Gehrels
2012-03-04 10:14:50 +00:00
parent 2e0d170b66
commit 6355ca279e

View File

@@ -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 @@ namespace strategy
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();