select_coordinate_type.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // This file was modified by Oracle on 2014.
  6. // Modifications copyright (c) 2014 Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  10. // Use, modification and distribution is subject to the Boost Software License,
  11. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. #ifndef BOOST_GEOMETRY_UTIL_SELECT_COORDINATE_TYPE_HPP
  14. #define BOOST_GEOMETRY_UTIL_SELECT_COORDINATE_TYPE_HPP
  15. #include <boost/geometry/core/coordinate_type.hpp>
  16. #include <boost/geometry/util/select_most_precise.hpp>
  17. namespace boost { namespace geometry
  18. {
  19. /*!
  20. \brief Meta-function selecting the most precise coordinate type
  21. of two geometries
  22. \ingroup utility
  23. */
  24. template <typename T1, typename T2 = void, typename T3 = void>
  25. struct select_coordinate_type
  26. {
  27. typedef typename select_most_precise
  28. <
  29. typename coordinate_type<T1>::type,
  30. typename coordinate_type<T2>::type,
  31. typename coordinate_type<T3>::type
  32. >::type type;
  33. };
  34. template <typename T1, typename T2>
  35. struct select_coordinate_type<T1, T2, void>
  36. {
  37. typedef typename select_most_precise
  38. <
  39. typename coordinate_type<T1>::type,
  40. typename coordinate_type<T2>::type
  41. >::type type;
  42. };
  43. template <typename T1>
  44. struct select_coordinate_type<T1, void, void>
  45. {
  46. typedef typename select_most_precise
  47. <
  48. typename coordinate_type<T1>::type
  49. >::type type;
  50. };
  51. }} // namespace boost::geometry
  52. #endif // BOOST_GEOMETRY_UTIL_SELECT_COORDINATE_TYPE_HPP