123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef BOOST_GEOMETRY_UTIL_COORDINATE_CAST_HPP
- #define BOOST_GEOMETRY_UTIL_COORDINATE_CAST_HPP
- #include <cstdlib>
- #include <string>
- #include <boost/lexical_cast.hpp>
- namespace boost { namespace geometry
- {
- #ifndef DOXYGEN_NO_DETAIL
- namespace detail
- {
- template <typename CoordinateType>
- struct coordinate_cast
- {
- static inline CoordinateType apply(std::string const& source)
- {
- #if defined(BOOST_GEOMETRY_NO_LEXICAL_CAST)
- return atof(source.c_str());
- #else
- return boost::lexical_cast<CoordinateType>(source);
- #endif
- }
- };
- }
- #endif
- }}
- #endif
|