default_length_result.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  3. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  6. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  7. // Use, modification and distribution is subject to the Boost Software License,
  8. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
  11. #define BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP
  12. #include <boost/geometry/core/coordinate_type.hpp>
  13. #include <boost/geometry/util/select_most_precise.hpp>
  14. namespace boost { namespace geometry
  15. {
  16. /*!
  17. \brief Meta-function defining return type of length function
  18. \ingroup length
  19. \note Length of a line of integer coordinates can be double.
  20. So we take at least a double. If Big Number types are used,
  21. we take that type.
  22. */
  23. template <typename Geometry>
  24. struct default_length_result
  25. {
  26. typedef typename select_most_precise
  27. <
  28. typename coordinate_type<Geometry>::type,
  29. long double
  30. >::type type;
  31. };
  32. }} // namespace boost::geometry
  33. #endif // BOOST_GEOMETRY_STRATEGIES_DEFAULT_LENGTH_RESULT_HPP