mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-13 00:22:10 +00:00
[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user